]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - libs/uilib/uilib.cpp
Wrap GtkTextView
[xonotic/netradiant.git] / libs / uilib / uilib.cpp
index 191990e05e1472efac561c09f8ad6e3ac7bc42f4..3b169fafc3a3cb6ec14029f0b06a6c925e09c8c7 100644 (file)
@@ -56,6 +56,13 @@ namespace ui {
         return ::file_dialog(*this, open, title, path, pattern, want_load, want_import, want_save);
     }
 
+    Window::Window(window_type type)
+            : Window(GTK_WINDOW(gtk_window_new(
+            type == window_type::TOP ? GTK_WINDOW_TOPLEVEL :
+            type == window_type::POPUP ? GTK_WINDOW_POPUP :
+            GTK_WINDOW_TOPLEVEL)))
+    { };
+
     Window Window::create_dialog_window(const char *title, void func(), void *data, int default_w, int default_h)
     {
         return Window(::create_dialog_window(*this, title, func, data, default_w, default_h));
@@ -130,6 +137,9 @@ namespace ui {
     HBox::HBox(bool homogenous, int spacing) : HBox(GTK_HBOX(gtk_hbox_new(homogenous, spacing)))
     { }
 
+    Image::Image() : Image(GTK_IMAGE(gtk_image_new()))
+    { }
+
     Label::Label(const char *label) : Label(GTK_LABEL(gtk_label_new(label)))
     { }
 
@@ -157,12 +167,18 @@ namespace ui {
             GTK_TABLE(gtk_table_new(rows, columns, homogenous)))
     { }
 
+    TextView::TextView() : TextView(GTK_TEXT_VIEW(gtk_text_view_new()))
+    { }
+
     TreePath::TreePath() : TreePath(gtk_tree_path_new())
     { }
 
     TreePath::TreePath(const char *path) : TreePath(gtk_tree_path_new_from_string(path))
     { }
 
+    TreeView::TreeView() : TreeView(GTK_TREE_VIEW(gtk_tree_view_new()))
+    { }
+
     TreeView::TreeView(TreeModel model) : TreeView(GTK_TREE_VIEW(gtk_tree_view_new_with_model(model)))
     { }