From 4d9b0222942bd11c490d476ae60f3709017b804b Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Mon, 21 Oct 2019 10:26:13 +0200 Subject: Add GtkSheet --- src/Gtk/Widgets/Sheet.icl | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/Gtk/Widgets/Sheet.icl (limited to 'src/Gtk/Widgets/Sheet.icl') diff --git a/src/Gtk/Widgets/Sheet.icl b/src/Gtk/Widgets/Sheet.icl new file mode 100644 index 0000000..9d8a50c --- /dev/null +++ b/src/Gtk/Widgets/Sheet.icl @@ -0,0 +1,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 -- cgit v1.2.3