From 62ac2189697f2a9276fded2fee31568bbcca41b8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Sat, 27 Dec 2014 12:50:11 -0500 Subject: [PATCH] lib/gtk: add `GtkWidget::destroy|show|hide` and avoid conflicts MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/gtk/v3_4/gtk_core.nit | 11 +++++++++++ lib/gtk/v3_4/gtk_dialogs.nit | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/gtk/v3_4/gtk_core.nit b/lib/gtk/v3_4/gtk_core.nit index cee996c..2e8dbfa 100644 --- a/lib/gtk/v3_4/gtk_core.nit +++ b/lib/gtk/v3_4/gtk_core.nit @@ -116,6 +116,17 @@ extern class GtkWidget `{GtkWidget *`} fun visible_self: Bool is extern `{ return gtk_widget_get_visible(recv); `} + + # Destroy the widget + fun destroy `{ gtk_widget_destroy(recv); `} + + # Show the widget on screen + # + # See: `show_all` to recursively show this widget and contained widgets. + fun show `{ gtk_widget_show(recv); `} + + # Hide the widget (reverse the effects of `show`) + fun hide `{ gtk_widget_hide(recv); `} end #Base class for widgets which contain other widgets diff --git a/lib/gtk/v3_4/gtk_dialogs.nit b/lib/gtk/v3_4/gtk_dialogs.nit index 7da083f..079eb71 100644 --- a/lib/gtk/v3_4/gtk_dialogs.nit +++ b/lib/gtk/v3_4/gtk_dialogs.nit @@ -119,8 +119,8 @@ extern class GtkAboutDialog `{GtkAboutDialog *`} # gtk_about_dialog_set_authors( recv, String_to_cstring( authors_list ) ); #`} - fun show ( parent : GtkWindow, params : String ) is extern import String.to_cstring`{ - gtk_show_about_dialog( parent, String_to_cstring( params ), NULL); + fun show_about_dialog(parent: GtkWindow, params: String) import String.to_cstring `{ + gtk_show_about_dialog(parent, String_to_cstring(params), NULL); `} end -- 1.7.9.5