]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - libs/uilib/uilib.h
Dialog: wrap GTK widgets in data binding
[xonotic/netradiant.git] / libs / uilib / uilib.h
index f02a51727939bc8ed1fa7f98b04b7e78065d5546..f873939f92b41a3be557ac22f1ef6d4c5dd92d31 100644 (file)
@@ -57,6 +57,7 @@ struct _GtkToolItem;
 struct _GtkTreeModel;
 struct _GtkTreePath;
 struct _GtkTreeSelection;
+struct _GtkTreeStore;
 struct _GtkTreeView;
 struct _GtkTreeViewColumn;
 struct _GtkVBox;
@@ -337,7 +338,8 @@ namespace ui {
 
     WRAP(ToggleButton, Button, _GtkToggleButton, (),
     ,
-         bool active();
+         bool active() const;
+         void active(bool value);
     );
 
     WRAP(CheckButton, ToggleButton, _GtkCheckButton, (),
@@ -439,9 +441,24 @@ namespace ui {
     ,
     );
 
+    struct TableAttach {
+        unsigned int left, right, top, bottom;
+    };
+
+    struct TableAttachOptions {
+        // todo: type safety
+        unsigned int x, y;
+    };
+
+    struct TablePadding {
+        unsigned int x, y;
+    };
+
     WRAP(Table, Container, _GtkTable, (),
          Table(std::size_t rows, std::size_t columns, bool homogenous);
     ,
+         // 5 = expand | fill
+         void attach(Widget child, TableAttach attach, TableAttachOptions options = {5, 5}, TablePadding padding = {0, 0});
     );
 
     WRAP(TextView, Container, _GtkTextView, (),
@@ -543,6 +560,10 @@ namespace ui {
          void append();
     );
 
+    WRAP(TreeStore, Object, _GtkTreeStore, (ITreeModel),
+    ,
+    );
+
     WRAP(TreeSelection, Object, _GtkTreeSelection, (),
     ,
     );