rendered paste body#include <stdio.h>#include <gtk/gtk.h>static void quit_button(GtkObject *gobject, gpointer data){ printf("print_button says bye\n"); gtk_main_quit();}int main(int argc, char **argv){ GtkWidget *window; GtkWidget *main_window_box; GtkWidget *main_window_pane; GtkWidget *top_menubar_box; GtkWidget *playlist_pane_vbox; GtkWidget *quit_button; GtkWidget *settings_button; GtkWidget *help_button; GtkWidget *status_bar; GtkWidget *scroll_playlist_window; gtk_init(&argc,&argv); /* Create the top level window */ window = gtk_window_new(GTK_WINDOW_TOPLEVEL); GdkGeometry gdkGeometry; gdkGeometry.min_width= 800; gdkGeometry.min_height = 600; gtk_window_set_geometry_hints(GTK_WINDOW(window), window, &gdkGeometry, GDK_HINT_MIN_SIZE); /* New Vbox (Homogeneous, Spacing) */ main_window_box = gtk_vbox_new(FALSE, 1); /* Add the vertical box to the window */ gtk_container_add(GTK_CONTAINER(window),main_window_box); /* Add a HBox to the top level of the Vbox (Homogeneous,Spacing) */ top_menubar_box = gtk_hbox_new(FALSE,1); /* Expand = False, Fill = False, Padding = 0 */ gtk_box_pack_start(GTK_BOX(main_window_box), top_menubar_box,FALSE,FALSE,0); /* Add a few buttons to the menu box */ quit_button = gtk_button_new_with_label("Quit"); help_button = gtk_button_new_with_label("Help"); settings_button = gtk_button_new_with_label("Settings"); /* Expand = False, Fill = False, Padding = 1 */ gtk_box_pack_start(GTK_BOX(top_menubar_box), settings_button,FALSE,FALSE, 1); gtk_box_pack_start(GTK_BOX(top_menubar_box), help_button, FALSE, FALSE, 1); gtk_box_pack_start(GTK_BOX(top_menubar_box), quit_button, FALSE, FALSE, 1); /* Connect signals for the buttons */ g_signal_connect (G_OBJECT (quit_button), "clicked", G_CALLBACK( quit_button), NULL); g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (quit_button), NULL); /* Add a horizontal pane to the main window */ main_window_pane = gtk_hpaned_new(); gtk_box_pack_start(GTK_BOX(main_window_box), main_window_pane,TRUE,TRUE,1); /* Create the playlist window */ scroll_playlist_window = gtk_scrolled_window_new(NULL,NULL); gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW(scroll_playlist_window), GTK_SHADOW_ETCHED_IN); gtk_scrolled_window_set_policy ( GTK_SCROLLED_WINDOW (scroll_playlist_window), GTK_POLICY_NEVER,GTK_POLICY_AUTOMATIC); playlist_pane_vbox = gtk_vbox_new(FALSE,0); /* Add the playlist window to the right hand side of the pane */ gtk_paned_add2(GTK_PANED(main_window_pane), playlist_pane_vbox); gtk_box_pack_start(GTK_BOX(playlist_pane_vbox),scroll_playlist_window,TRUE,TRUE,0); /* Add a status bar to the bottom of the main window */ status_bar = gtk_statusbar_new(); /* Expand = False, Fill = True, Padding = 0 */ gtk_box_pack_end(GTK_BOX(main_window_box),status_bar, FALSE, TRUE, 0); gtk_widget_show_all(window); gtk_main(); printf("After Main\n"); return 0;}