summaryrefslogtreecommitdiff
path: root/src/Gtk/Widgets/Sheet.icl
diff options
context:
space:
mode:
authorCamil Staps2019-10-23 16:23:10 +0200
committerCamil Staps2019-10-23 16:23:10 +0200
commit63a7f69566f25d5033fc9556da637408e92f1f92 (patch)
treeb48b2dcd500e9d934e0234999d99a1829d4151c7 /src/Gtk/Widgets/Sheet.icl
parentAdd EnterPressedHandler for GtkSheet (diff)
Add get/setActiveCell for GtkSheet
Diffstat (limited to 'src/Gtk/Widgets/Sheet.icl')
-rw-r--r--src/Gtk/Widgets/Sheet.icl13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Gtk/Widgets/Sheet.icl b/src/Gtk/Widgets/Sheet.icl
index e34a304..07789df 100644
--- a/src/Gtk/Widgets/Sheet.icl
+++ b/src/Gtk/Widgets/Sheet.icl
@@ -1,6 +1,7 @@
implementation module Gtk.Widgets.Sheet
import StdEnv
+import StdMaybe
import Control.Monad
import System._Pointer
@@ -52,6 +53,18 @@ setCellText row col text sheet =
toState (gtk_sheet_set_cell_text sheet row col text) >>|
pure sheet
+getActiveCell :: !GtkSheet -> GtkM (Maybe (Int,Int))
+getActiveCell sheet =
+ toStateR (gtk_sheet_get_active_cell sheet) >>= \cell=:(row,col)
+ | row < 0 || col < 0
+ -> pure Nothing
+ -> pure (Just cell)
+
+setActiveCell :: !Int !Int !GtkSheet -> GtkM GtkSheet
+setActiveCell row col sheet =
+ toState (gtk_sheet_set_active_cell sheet row col) >>|
+ pure sheet
+
instance tune GtkSheet GtkSheetColumnResizability
where
tune setting sheet =