Permalink
Browse files

Don't access GtkDialog fields directly

  • Loading branch information...
1 parent 3b14cca commit 4d1673538099b29782292ba92d3605e48b8214f0 @b4n b4n committed Sep 11, 2012
Showing with 9 additions and 9 deletions.
  1. +2 −2 src/about.c
  2. +2 −2 src/gb.c
  3. +2 −2 src/prefs.c
  4. +2 −2 src/search.c
  5. +1 −1 src/ui_utils.c
View
@@ -183,7 +183,7 @@ static GtkWidget *create_dialog(void)
header_label_style_set(header_label);
g_signal_connect_after(header_eventbox, "style-set", G_CALLBACK(header_eventbox_style_set), NULL);
g_signal_connect_after(header_label, "style-set", G_CALLBACK(header_label_style_set), NULL);
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), header_eventbox, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), header_eventbox, FALSE, FALSE, 0);
/* set image */
icon = ui_new_pixbuf_from_inline(GEANY_IMAGE_LOGO);
@@ -195,7 +195,7 @@ static GtkWidget *create_dialog(void)
notebook = gtk_notebook_new();
gtk_widget_show(notebook);
gtk_container_set_border_width(GTK_CONTAINER(notebook), 2);
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), notebook, TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), notebook, TRUE, TRUE, 0);
/* create "Info" tab */
info_box = gtk_vbox_new(FALSE, 0);
View
@@ -159,7 +159,7 @@ static GtkWidget *create_help_dialog(GtkWindow *parent)
gtk_window_set_modal(GTK_WINDOW(help_dialog), TRUE);
gtk_window_set_transient_for(GTK_WINDOW(help_dialog), parent);
- dialog_vbox1 = GTK_DIALOG(help_dialog)->vbox;
+ dialog_vbox1 = gtk_dialog_get_content_area(GTK_DIALOG(help_dialog));
gtk_widget_show(dialog_vbox1);
scrolledwindow1 = gtk_scrolled_window_new(NULL, NULL);
@@ -184,7 +184,7 @@ static GtkWidget *create_help_dialog(GtkWindow *parent)
gtk_text_view_set_left_margin(GTK_TEXT_VIEW(textview1), 1);
gtk_text_view_set_right_margin(GTK_TEXT_VIEW(textview1), 1);
- dialog_action_area1 = GTK_DIALOG(help_dialog)->action_area;
+ dialog_action_area1 = gtk_dialog_get_action_area(GTK_DIALOG(help_dialog));
gtk_widget_show(dialog_action_area1);
gtk_button_box_set_layout(GTK_BUTTON_BOX(dialog_action_area1), GTK_BUTTONBOX_END);
View
@@ -185,11 +185,11 @@ static void kb_tree_view_change_button_clicked_cb(GtkWidget *button, gpointer da
_("Press the combination of the keys you want to use for \"%s\"."), name);
label = gtk_label_new(str);
gtk_misc_set_padding(GTK_MISC(label), 5, 10);
- gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), label);
+ gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), label);
dialog_label = gtk_label_new("");
gtk_misc_set_padding(GTK_MISC(dialog_label), 5, 10);
- gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), dialog_label);
+ gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), dialog_label);
g_signal_connect(dialog, "key-press-event",
G_CALLBACK(kb_grab_key_dialog_key_press_cb), NULL);
View
@@ -539,7 +539,7 @@ static void create_find_dialog(void)
gtk_button_box_set_child_secondary(GTK_BUTTON_BOX(bbox), check_close, TRUE);
ui_hbutton_box_copy_layout(
- GTK_BUTTON_BOX(GTK_DIALOG(find_dlg.dialog)->action_area),
+ GTK_BUTTON_BOX(gtk_dialog_get_action_area(GTK_DIALOG(find_dlg.dialog))),
GTK_BUTTON_BOX(bbox));
gtk_container_add(GTK_CONTAINER(exp), bbox);
gtk_container_add(GTK_CONTAINER(vbox), exp);
@@ -721,7 +721,7 @@ static void create_replace_dialog(void)
gtk_button_box_set_child_secondary(GTK_BUTTON_BOX(bbox), check_close, TRUE);
ui_hbutton_box_copy_layout(
- GTK_BUTTON_BOX(GTK_DIALOG(replace_dlg.dialog)->action_area),
+ GTK_BUTTON_BOX(gtk_dialog_get_action_area(GTK_DIALOG(replace_dlg.dialog))),
GTK_BUTTON_BOX(bbox));
gtk_container_add(GTK_CONTAINER(exp), bbox);
gtk_container_add(GTK_CONTAINER(vbox), exp);
View
@@ -1403,7 +1403,7 @@ GtkWidget *ui_dialog_vbox_new(GtkDialog *dialog)
GtkWidget *vbox = gtk_vbox_new(FALSE, 12); /* need child vbox to set a separate border. */
gtk_container_set_border_width(GTK_CONTAINER(vbox), 6);
- gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), vbox);
+ gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), vbox);
return vbox;
}

0 comments on commit 4d16735

Please sign in to comment.