X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fnetradiant.git;a=blobdiff_plain;f=libs%2Fuilib%2Fuilib.cpp;h=d3cd197251f15251a941a0b11879d006da0f12ce;hp=4832d92ffaec570a49318cd813b8c96d7eb17041;hb=6e9818d9cddf3880d001a544770c8c2c5187676f;hpb=f92114c3f8baaedf9e0a4ff21141e9349d838f5c diff --git a/libs/uilib/uilib.cpp b/libs/uilib/uilib.cpp index 4832d92f..d3cd1972 100644 --- a/libs/uilib/uilib.cpp +++ b/libs/uilib/uilib.cpp @@ -97,11 +97,25 @@ namespace ui { 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::hide() + { + gtk_widget_hide(this); + } + Dimensions IWidget::dimensions() { GtkAllocation allocation; @@ -114,6 +128,11 @@ namespace ui { gtk_widget_set_size_request(this, width, height); } + void IWidget::destroy() + { + gtk_widget_destroy(this); + } + IMPL(Container, GTK_CONTAINER); void IContainer::add(Widget widget)