summaryrefslogtreecommitdiff
path: root/src/Gtk/Widgets.icl
diff options
context:
space:
mode:
authorCamil Staps2019-10-30 19:45:59 +0100
committerCamil Staps2019-10-30 19:45:59 +0100
commit6eb82f6660f402f64049c0aa8dab6734b05dbf43 (patch)
treea551643e81d7d93b326e1e4f5aeea779a09d18d8 /src/Gtk/Widgets.icl
parentExport all derived strictness (diff)
Add GtkEntryCompletion
Diffstat (limited to 'src/Gtk/Widgets.icl')
-rw-r--r--src/Gtk/Widgets.icl33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/Gtk/Widgets.icl b/src/Gtk/Widgets.icl
index 9573966..2c522d0 100644
--- a/src/Gtk/Widgets.icl
+++ b/src/Gtk/Widgets.icl
@@ -166,6 +166,39 @@ where
toState (gtk_entry_set_text e text) >>|
pure entry
+instance tune GtkEntry GtkEntryCompletion
+where
+ tune (GtkEntryCompletion ec) entry=:(GtkEntry e) =
+ toState (gtk_entry_set_completion e ec) >>|
+ pure entry
+
+newEntryCompletion :: GtkM GtkEntryCompletion
+newEntryCompletion =
+ toStateR gtk_entry_completion_new >>= \ec ->
+ toState (gtk_entry_completion_set_inline_selection ec True) >>| // TODO
+ pure (GtkEntryCompletion ec)
+
+setTextColumn :: !Int !GtkEntryCompletion -> GtkM GtkEntryCompletion
+setTextColumn col completion=:(GtkEntryCompletion ec) =
+ toState (gtk_entry_completion_set_text_column ec col) >>|
+ pure completion
+
+instance tune GtkEntryCompletion GtkListStore
+where
+ tune (GtkListStore ls) completion=:(GtkEntryCompletion ec) =
+ toState (gtk_entry_completion_set_model ec ls) >>|
+ pure completion
+
+instance tune GtkEntryCompletion GtkCompletionMode
+where
+ tune mode completion=:(GtkEntryCompletion ec) = set >>| pure completion
+ where
+ set = toState case mode of
+ InlineCompletion -> gtk_entry_completion_set_inline_completion ec True
+ NoInlineCompletion -> gtk_entry_completion_set_inline_completion ec False
+ InlineSelection -> gtk_entry_completion_set_inline_selection ec True
+ NoInlineSelection -> gtk_entry_completion_set_inline_selection ec False
+
instance gtkWidget GtkFrame where gtkWidget (GtkFrame f) = GtkWidget f
instance gtkContainer GtkFrame where gtkContainer (GtkFrame f) = GtkContainer f