diff options
author | Javier Jardón <jjardon@gnome.org> | 2010-06-03 09:36:39 +0200 |
---|---|---|
committer | Javier Jardón <jjardon@gnome.org> | 2010-07-13 19:40:47 +0200 |
commit | 7f2cc85db96afb9806fc62ce6e32c47e49a9f4d3 (patch) | |
tree | 9b4e9a147f29c3ac181d1901579c9dd16a386acc /demos/gtk-demo/changedisplay.c | |
parent | 80df961edb1557bae3a545e6b18871d7c4c6f566 (diff) | |
download | gtk+-7f2cc85db96afb9806fc62ce6e32c47e49a9f4d3.tar.gz |
Use accessor functions to access GtkDialog
Diffstat (limited to 'demos/gtk-demo/changedisplay.c')
-rw-r--r-- | demos/gtk-demo/changedisplay.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/demos/gtk-demo/changedisplay.c b/demos/gtk-demo/changedisplay.c index e12eb789d4..b178364657 100644 --- a/demos/gtk-demo/changedisplay.c +++ b/demos/gtk-demo/changedisplay.c @@ -229,6 +229,7 @@ static void open_display_cb (GtkWidget *button, ChangeDisplayInfo *info) { + GtkWidget *content_area; GtkWidget *dialog; GtkWidget *display_entry; GtkWidget *dialog_label; @@ -248,8 +249,10 @@ open_display_cb (GtkWidget *button, dialog_label = gtk_label_new ("Please enter the name of\nthe new display\n"); - gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), dialog_label); - gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), display_entry); + content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); + + gtk_container_add (GTK_CONTAINER (content_area), dialog_label); + gtk_container_add (GTK_CONTAINER (content_area), display_entry); gtk_widget_grab_focus (display_entry); gtk_widget_show_all (gtk_bin_get_child (GTK_BIN (dialog))); @@ -599,6 +602,7 @@ do_changedisplay (GtkWidget *do_widget) if (!info) { + GtkWidget *content_area; GtkWidget *vbox; GtkWidget *frame; @@ -618,11 +622,11 @@ do_changedisplay (GtkWidget *do_widget) g_signal_connect (info->window, "destroy", G_CALLBACK (destroy_cb), &info); + content_area = gtk_dialog_get_content_area (GTK_DIALOG (info->window)); + vbox = gtk_vbox_new (FALSE, 5); gtk_container_set_border_width (GTK_CONTAINER (vbox), 8); - - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (info->window)->vbox), vbox, - TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0); frame = create_display_frame (info); gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0); |