From cf8c23098eb0687b923e9ce3a50bd9f34bf3089c Mon Sep 17 00:00:00 2001 From: TimePath Date: Wed, 17 Feb 2016 18:33:46 +1100 Subject: [PATCH] Wrap GtkImage --- libs/uilib/uilib.cpp | 3 +++ libs/uilib/uilib.h | 5 +++++ radiant/commands.cpp | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/libs/uilib/uilib.cpp b/libs/uilib/uilib.cpp index 0e40539d..589da73c 100644 --- a/libs/uilib/uilib.cpp +++ b/libs/uilib/uilib.cpp @@ -137,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))) { } diff --git a/libs/uilib/uilib.h b/libs/uilib/uilib.h index b6f8fc84..7e943985 100644 --- a/libs/uilib/uilib.h +++ b/libs/uilib/uilib.h @@ -17,6 +17,7 @@ using ui_evkey = struct _GdkEventKey; using ui_frame = struct _GtkFrame; using ui_hbox = struct _GtkHBox; using ui_hpaned = struct _GtkHPaned; +using ui_image = struct _GtkImage; using ui_label = struct _GtkLabel; using ui_menu = struct _GtkMenu; using ui_menuitem = struct _GtkMenuItem; @@ -181,6 +182,10 @@ namespace ui { HBox(bool homogenous, int spacing); ); + WRAP(Image, Widget, ui_image, + Image(); + ); + WRAP(Label, Widget, ui_label, Label(const char *label); ); diff --git a/radiant/commands.cpp b/radiant/commands.cpp index a431257a..4232549c 100644 --- a/radiant/commands.cpp +++ b/radiant/commands.cpp @@ -474,7 +474,7 @@ public: GtkButton* clearbutton = create_dialog_button( "Clear", (GCallback) accelerator_clear_button_clicked, &dialog ); gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( clearbutton ), FALSE, FALSE, 0 ); - ui::Widget spacer = ui::Widget(gtk_image_new()); + ui::Widget spacer = ui::Image(); gtk_widget_show( spacer ); gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( spacer ), TRUE, TRUE, 0 ); -- 2.39.2