From 334d83ed0887d0691e10645a1d43b716dc6bd7f0 Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Thu, 25 Oct 2012 11:29:46 +0400 Subject: [PATCH] Quit button --- c/gtk-tutorial/helloworld/helloworld_with_box.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/c/gtk-tutorial/helloworld/helloworld_with_box.c b/c/gtk-tutorial/helloworld/helloworld_with_box.c index 71f6389..d5d224d 100644 --- a/c/gtk-tutorial/helloworld/helloworld_with_box.c +++ b/c/gtk-tutorial/helloworld/helloworld_with_box.c @@ -82,6 +82,13 @@ int main( int argc, * recommend showing the window last, so it all pops up at once. */ gtk_widget_show (button); + /* Add quiet button */ + button = gtk_button_new_with_label ("Quit"); + g_signal_connect_swapped (G_OBJECT (button), "clicked", + G_CALLBACK (delete_event), G_OBJECT (window)); + gtk_box_pack_start (GTK_BOX (box1), button, TRUE, TRUE, 0); + gtk_widget_show (button); + gtk_widget_show (box1); gtk_widget_show (window);