summaryrefslogtreecommitdiff
path: root/src/Gtk/Widgets/Sheet.icl
blob: 9d8a50caac7ae36d1447e15034282d0580e625bb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
implementation module Gtk.Widgets.Sheet

/**
 * This module provides support for GtkSheet; a spreadsheet widget. See
 * https://fpaquet.github.io/gtksheet/ for more details and installation
 * instructions. Use the 'Gtk with GtkSheet' environment.
 */

import Control.Monad
import Control.Monad.Identity
import Control.Monad.State
import System._Pointer

import Gtk
import qualified Gtk.Widgets.Sheet.Internal as I

:: GtkSheet :== Pointer

instance gtkWidget GtkSheet    where gtkWidget s    = fromPtr s
instance gtkContainer GtkSheet where gtkContainer s = fromPtr s

newSheet :: !Int !Int !String -> GtkM GtkSheet
newSheet nrows ncols title =
	toStateR ('I'.gtk_sheet_new nrows ncols title) >>= show