]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - libs/uilib/uilib.cpp
Wrap more GTK
[xonotic/netradiant.git] / libs / uilib / uilib.cpp
index 4832d92ffaec570a49318cd813b8c96d7eb17041..d3cd197251f15251a941a0b11879d006da0f12ce 100644 (file)
@@ -97,11 +97,25 @@ namespace ui {
         return gtk_widget_get_visible(this) != 0;
     }
 
         return gtk_widget_get_visible(this) != 0;
     }
 
+    void IWidget::visible(bool shown)
+    {
+        if (shown) {
+            this.show();
+        } else {
+            this.hide();
+        }
+    }
+
     void IWidget::show()
     {
         gtk_widget_show(this);
     }
 
     void IWidget::show()
     {
         gtk_widget_show(this);
     }
 
+    void IWidget::hide()
+    {
+        gtk_widget_hide(this);
+    }
+
     Dimensions IWidget::dimensions()
     {
         GtkAllocation allocation;
     Dimensions IWidget::dimensions()
     {
         GtkAllocation allocation;
@@ -114,6 +128,11 @@ namespace ui {
         gtk_widget_set_size_request(this, width, height);
     }
 
         gtk_widget_set_size_request(this, width, height);
     }
 
+    void IWidget::destroy()
+    {
+        gtk_widget_destroy(this);
+    }
+
     IMPL(Container, GTK_CONTAINER);
 
     void IContainer::add(Widget widget)
     IMPL(Container, GTK_CONTAINER);
 
     void IContainer::add(Widget widget)