[gtk+/refactor: 40/106] Use accessor functions to access GtkDialog
- From: Javier Jardón <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/refactor: 40/106] Use accessor functions to access GtkDialog
- Date: Tue, 13 Jul 2010 17:33:22 +0000 (UTC)
commit 2c6efd81f178e0b55f12d47dcc99f45288b3f7b9
Author: Javier Jardón <jjardon gnome org>
Date: Thu Jun 3 09:36:39 2010 +0200
Use accessor functions to access GtkDialog
demos/gtk-demo/changedisplay.c | 14 ++-
demos/gtk-demo/dialog.c | 5 +-
demos/gtk-demo/entry_buffer.c | 5 +-
demos/gtk-demo/entry_completion.c | 5 +-
demos/gtk-demo/expander.c | 5 +-
demos/gtk-demo/search_entry.c | 5 +-
demos/gtk-demo/sizegroup.c | 5 +-
demos/gtk-demo/spinner.c | 5 +-
gtk/gtkcolorseldialog.c | 12 +-
gtk/gtkcustompaperunixdialog.c | 15 ++-
gtk/gtkfilechooserdialog.c | 34 ++++--
gtk/gtkfontsel.c | 14 ++-
gtk/gtkmessagedialog.c | 13 ++-
gtk/gtkmountoperation.c | 12 +-
gtk/gtkpagesetupunixdialog.c | 12 +-
gtk/gtkprintbackend.c | 4 +-
gtk/gtkprintunixdialog.c | 12 +-
gtk/gtkrecentchooserdialog.c | 28 +++-
gtk/tests/builder.c | 11 +-
modules/other/gail/tests/testimage.c | 23 ++--
tests/testcombochange.c | 7 +-
tests/testfilechooserbutton.c | 15 ++-
tests/testgtk.c | 250 ++++++++++++++++++++--------------
tests/testmultidisplay.c | 12 +-
tests/testselection.c | 13 +-
tests/teststatusicon.c | 9 +-
26 files changed, 344 insertions(+), 201 deletions(-)
---
diff --git a/demos/gtk-demo/changedisplay.c b/demos/gtk-demo/changedisplay.c
index e12eb78..b178364 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);
diff --git a/demos/gtk-demo/dialog.c b/demos/gtk-demo/dialog.c
index 301ee2f..336febc 100644
--- a/demos/gtk-demo/dialog.c
+++ b/demos/gtk-demo/dialog.c
@@ -33,6 +33,7 @@ static void
interactive_dialog_clicked (GtkButton *button,
gpointer user_data)
{
+ GtkWidget *content_area;
GtkWidget *dialog;
GtkWidget *hbox;
GtkWidget *stock;
@@ -51,9 +52,11 @@ interactive_dialog_clicked (GtkButton *button,
GTK_RESPONSE_CANCEL,
NULL);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+
hbox = gtk_hbox_new (FALSE, 8);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), hbox, FALSE, FALSE, 0);
stock = gtk_image_new_from_stock (GTK_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_DIALOG);
gtk_box_pack_start (GTK_BOX (hbox), stock, FALSE, FALSE, 0);
diff --git a/demos/gtk-demo/entry_buffer.c b/demos/gtk-demo/entry_buffer.c
index 82f07c9..6c4d34d 100644
--- a/demos/gtk-demo/entry_buffer.c
+++ b/demos/gtk-demo/entry_buffer.c
@@ -11,6 +11,7 @@ static GtkWidget *window = NULL;
GtkWidget *
do_entry_buffer (GtkWidget *do_widget)
{
+ GtkWidget *content_area;
GtkWidget *vbox;
GtkWidget *label;
GtkWidget *entry;
@@ -31,8 +32,10 @@ do_entry_buffer (GtkWidget *do_widget)
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
+
vbox = gtk_vbox_new (FALSE, 5);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
label = gtk_label_new (NULL);
diff --git a/demos/gtk-demo/entry_completion.c b/demos/gtk-demo/entry_completion.c
index f7e61e9..e9a3e24 100644
--- a/demos/gtk-demo/entry_completion.c
+++ b/demos/gtk-demo/entry_completion.c
@@ -37,6 +37,7 @@ create_completion_model (void)
GtkWidget *
do_entry_completion (GtkWidget *do_widget)
{
+ GtkWidget *content_area;
GtkWidget *vbox;
GtkWidget *label;
GtkWidget *entry;
@@ -58,8 +59,10 @@ do_entry_completion (GtkWidget *do_widget)
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
+
vbox = gtk_vbox_new (FALSE, 5);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
label = gtk_label_new (NULL);
diff --git a/demos/gtk-demo/expander.c b/demos/gtk-demo/expander.c
index acd51ba..9b384fb 100644
--- a/demos/gtk-demo/expander.c
+++ b/demos/gtk-demo/expander.c
@@ -13,6 +13,7 @@ static GtkWidget *window = NULL;
GtkWidget *
do_expander (GtkWidget *do_widget)
{
+ GtkWidget *content_area;
GtkWidget *vbox;
GtkWidget *label;
GtkWidget *expander;
@@ -32,8 +33,10 @@ do_expander (GtkWidget *do_widget)
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
+
vbox = gtk_vbox_new (FALSE, 5);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
label = gtk_label_new ("Expander demo. Click on the triangle for details.");
diff --git a/demos/gtk-demo/search_entry.c b/demos/gtk-demo/search_entry.c
index 580dd13..1e5c747 100644
--- a/demos/gtk-demo/search_entry.c
+++ b/demos/gtk-demo/search_entry.c
@@ -241,6 +241,7 @@ entry_populate_popup (GtkEntry *entry,
GtkWidget *
do_search_entry (GtkWidget *do_widget)
{
+ GtkWidget *content_area;
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *label;
@@ -263,8 +264,10 @@ do_search_entry (GtkWidget *do_widget)
g_signal_connect (window, "destroy",
G_CALLBACK (search_entry_destroyed), &window);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
+
vbox = gtk_vbox_new (FALSE, 5);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
label = gtk_label_new (NULL);
diff --git a/demos/gtk-demo/sizegroup.c b/demos/gtk-demo/sizegroup.c
index e238b95..23d18d9 100644
--- a/demos/gtk-demo/sizegroup.c
+++ b/demos/gtk-demo/sizegroup.c
@@ -82,6 +82,7 @@ toggle_grouping (GtkToggleButton *check_button,
GtkWidget *
do_sizegroup (GtkWidget *do_widget)
{
+ GtkWidget *content_area;
GtkWidget *table;
GtkWidget *frame;
GtkWidget *vbox;
@@ -115,8 +116,10 @@ do_sizegroup (GtkWidget *do_widget)
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
+
vbox = gtk_vbox_new (FALSE, 5);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
diff --git a/demos/gtk-demo/spinner.c b/demos/gtk-demo/spinner.c
index cf82440..53938f9 100644
--- a/demos/gtk-demo/spinner.c
+++ b/demos/gtk-demo/spinner.c
@@ -27,6 +27,7 @@ on_stop_clicked (GtkButton *button, gpointer user_data)
GtkWidget *
do_spinner (GtkWidget *do_widget)
{
+ GtkWidget *content_area;
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *button;
@@ -47,8 +48,10 @@ do_spinner (GtkWidget *do_widget)
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
+
vbox = gtk_vbox_new (FALSE, 5);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
/* Sensitive */
diff --git a/gtk/gtkcolorseldialog.c b/gtk/gtkcolorseldialog.c
index 9de4d81..a203de4 100644
--- a/gtk/gtkcolorseldialog.c
+++ b/gtk/gtkcolorseldialog.c
@@ -141,23 +141,27 @@ gtk_color_selection_dialog_init (GtkColorSelectionDialog *colorseldiag)
{
GtkColorSelectionDialogPriv *priv;
GtkDialog *dialog = GTK_DIALOG (colorseldiag);
+ GtkWidget *action_area, *content_area;
colorseldiag->priv = G_TYPE_INSTANCE_GET_PRIVATE (colorseldiag,
GTK_TYPE_COLOR_SELECTION_DIALOG,
GtkColorSelectionDialogPriv);
priv = colorseldiag->priv;
+ content_area = gtk_dialog_get_content_area (dialog);
+ action_area = gtk_dialog_get_action_area (dialog);
+
gtk_dialog_set_has_separator (dialog, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
- gtk_box_set_spacing (GTK_BOX (dialog->vbox), 2); /* 2 * 5 + 2 = 12 */
- gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 5);
- gtk_box_set_spacing (GTK_BOX (dialog->action_area), 6);
+ gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
+ gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
+ gtk_box_set_spacing (GTK_BOX (action_area), 6);
priv->colorsel = gtk_color_selection_new ();
gtk_container_set_border_width (GTK_CONTAINER (priv->colorsel), 5);
gtk_color_selection_set_has_palette (GTK_COLOR_SELECTION (priv->colorsel), FALSE);
gtk_color_selection_set_has_opacity_control (GTK_COLOR_SELECTION (priv->colorsel), FALSE);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (colorseldiag)->vbox), priv->colorsel);
+ gtk_container_add (GTK_CONTAINER (content_area), priv->colorsel);
gtk_widget_show (priv->colorsel);
priv->cancel_button = gtk_dialog_add_button (dialog,
diff --git a/gtk/gtkcustompaperunixdialog.c b/gtk/gtkcustompaperunixdialog.c
index cc95bec..ffd23e8 100644
--- a/gtk/gtkcustompaperunixdialog.c
+++ b/gtk/gtkcustompaperunixdialog.c
@@ -963,6 +963,8 @@ static void
populate_dialog (GtkCustomPaperUnixDialog *dialog)
{
GtkCustomPaperUnixDialogPrivate *priv = dialog->priv;
+ GtkDialog *cpu_dialog = GTK_DIALOG (dialog);
+ GtkWidget *action_area, *content_area;
GtkWidget *image, *table, *label, *widget, *frame, *combo;
GtkWidget *hbox, *vbox, *treeview, *scrolled, *button_box, *button;
GtkCellRenderer *cell;
@@ -971,15 +973,18 @@ populate_dialog (GtkCustomPaperUnixDialog *dialog)
GtkTreeSelection *selection;
GtkUnit user_units;
- gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
+ content_area = gtk_dialog_get_content_area (cpu_dialog);
+ action_area = gtk_dialog_get_action_area (cpu_dialog);
+
+ gtk_dialog_set_has_separator (cpu_dialog, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 2); /* 2 * 5 + 2 = 12 */
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->action_area), 6);
+ gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
+ gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
+ gtk_box_set_spacing (GTK_BOX (action_area), 6);
hbox = gtk_hbox_new (FALSE, 18);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), hbox, TRUE, TRUE, 0);
gtk_widget_show (hbox);
vbox = gtk_vbox_new (FALSE, 6);
diff --git a/gtk/gtkfilechooserdialog.c b/gtk/gtkfilechooserdialog.c
index ad1f911..491594e 100644
--- a/gtk/gtkfilechooserdialog.c
+++ b/gtk/gtkfilechooserdialog.c
@@ -80,6 +80,7 @@ gtk_file_chooser_dialog_class_init (GtkFileChooserDialogClass *class)
static void
gtk_file_chooser_dialog_init (GtkFileChooserDialog *dialog)
{
+ GtkWidget *action_area, *content_area;
GtkFileChooserDialogPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (dialog,
GTK_TYPE_FILE_CHOOSER_DIALOG,
GtkFileChooserDialogPrivate);
@@ -88,10 +89,13 @@ gtk_file_chooser_dialog_init (GtkFileChooserDialog *dialog)
dialog->priv = priv;
dialog->priv->response_requested = FALSE;
+ content_area = gtk_dialog_get_content_area (fc_dialog);
+ action_area = gtk_dialog_get_action_area (fc_dialog);
+
gtk_dialog_set_has_separator (fc_dialog, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (fc_dialog), 5);
- gtk_box_set_spacing (GTK_BOX (fc_dialog->vbox), 2); /* 2 * 5 + 2 = 12 */
- gtk_container_set_border_width (GTK_CONTAINER (fc_dialog->action_area), 5);
+ gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
+ gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
/* We do a signal connection here rather than overriding the method in
* class_init because GtkDialog::response is a RUN_LAST signal. We want *our*
@@ -126,6 +130,8 @@ static void
file_chooser_widget_file_activated (GtkFileChooser *chooser,
GtkFileChooserDialog *dialog)
{
+ GtkDialog *fc_dialog = GTK_DIALOG (dialog);
+ GtkWidget *action_area;
GList *children, *l;
if (gtk_window_activate_default (GTK_WINDOW (dialog)))
@@ -134,8 +140,8 @@ file_chooser_widget_file_activated (GtkFileChooser *chooser,
/* There probably isn't a default widget, so make things easier for the
* programmer by looking for a reasonable button on our own.
*/
-
- children = gtk_container_get_children (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area));
+ action_area = gtk_dialog_get_action_area (fc_dialog);
+ children = gtk_container_get_children (GTK_CONTAINER (action_area));
for (l = children; l; l = l->next)
{
@@ -143,7 +149,7 @@ file_chooser_widget_file_activated (GtkFileChooser *chooser,
int response_id;
widget = GTK_WIDGET (l->data);
- response_id = gtk_dialog_get_response_for_widget (GTK_DIALOG (dialog), widget);
+ response_id = gtk_dialog_get_response_for_widget (fc_dialog, widget);
if (is_stock_accept_response_id (response_id))
{
gtk_widget_activate (widget); /* Should we gtk_dialog_response (dialog, response_id) instead? */
@@ -221,6 +227,8 @@ static void
file_chooser_widget_response_requested (GtkWidget *widget,
GtkFileChooserDialog *dialog)
{
+ GtkDialog *fc_dialog = GTK_DIALOG (dialog);
+ GtkWidget *action_area;
GList *children, *l;
dialog->priv->response_requested = TRUE;
@@ -231,8 +239,8 @@ file_chooser_widget_response_requested (GtkWidget *widget,
/* There probably isn't a default widget, so make things easier for the
* programmer by looking for a reasonable button on our own.
*/
-
- children = gtk_container_get_children (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area));
+ action_area = gtk_dialog_get_action_area (fc_dialog);
+ children = gtk_container_get_children (GTK_CONTAINER (action_area));
for (l = children; l; l = l->next)
{
@@ -240,7 +248,7 @@ file_chooser_widget_response_requested (GtkWidget *widget,
int response_id;
widget = GTK_WIDGET (l->data);
- response_id = gtk_dialog_get_response_for_widget (GTK_DIALOG (dialog), widget);
+ response_id = gtk_dialog_get_response_for_widget (fc_dialog, widget);
if (is_stock_accept_response_id (response_id))
{
gtk_widget_activate (widget); /* Should we gtk_dialog_response (dialog, response_id) instead? */
@@ -260,6 +268,7 @@ gtk_file_chooser_dialog_constructor (GType type,
GObjectConstructParam *construct_params)
{
GtkFileChooserDialogPrivate *priv;
+ GtkWidget *content_area;
GObject *object;
object = G_OBJECT_CLASS (gtk_file_chooser_dialog_parent_class)->constructor (type,
@@ -282,8 +291,10 @@ gtk_file_chooser_dialog_constructor (GType type,
g_signal_connect (priv->widget, "response-requested",
G_CALLBACK (file_chooser_widget_response_requested), object);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (object));
+
gtk_container_set_border_width (GTK_CONTAINER (priv->widget), 5);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (object)->vbox), priv->widget, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), priv->widget, TRUE, TRUE, 0);
gtk_widget_show (priv->widget);
@@ -338,7 +349,10 @@ foreach_ensure_default_response_cb (GtkWidget *widget,
static void
ensure_default_response (GtkFileChooserDialog *dialog)
{
- gtk_container_foreach (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area),
+ GtkWidget *action_area;
+
+ action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
+ gtk_container_foreach (GTK_CONTAINER (action_area),
foreach_ensure_default_response_cb,
dialog);
}
diff --git a/gtk/gtkfontsel.c b/gtk/gtkfontsel.c
index 9438b94..ae433ba 100644
--- a/gtk/gtkfontsel.c
+++ b/gtk/gtkfontsel.c
@@ -1552,18 +1552,22 @@ static void
gtk_font_selection_dialog_init (GtkFontSelectionDialog *fontseldiag)
{
GtkDialog *dialog = GTK_DIALOG (fontseldiag);
+ GtkWidget *action_area, *content_area;
+
+ content_area = gtk_dialog_get_content_area (dialog);
+ action_area = gtk_dialog_get_action_area (dialog);
gtk_dialog_set_has_separator (dialog, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
- gtk_box_set_spacing (GTK_BOX (dialog->vbox), 2); /* 2 * 5 + 2 = 12 */
- gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 5);
- gtk_box_set_spacing (GTK_BOX (dialog->action_area), 6);
+ gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
+ gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
+ gtk_box_set_spacing (GTK_BOX (action_area), 6);
gtk_widget_push_composite_child ();
gtk_window_set_resizable (GTK_WINDOW (fontseldiag), TRUE);
- fontseldiag->main_vbox = dialog->vbox;
+ fontseldiag->main_vbox = content_area;
fontseldiag->fontsel = gtk_font_selection_new ();
gtk_container_set_border_width (GTK_CONTAINER (fontseldiag->fontsel), 5);
@@ -1572,7 +1576,7 @@ gtk_font_selection_dialog_init (GtkFontSelectionDialog *fontseldiag)
fontseldiag->fontsel, TRUE, TRUE, 0);
/* Create the action area */
- fontseldiag->action_area = dialog->action_area;
+ fontseldiag->action_area = action_area;
fontseldiag->cancel_button = gtk_dialog_add_button (dialog,
GTK_STOCK_CANCEL,
diff --git a/gtk/gtkmessagedialog.c b/gtk/gtkmessagedialog.c
index 2bd1d14..7eaca48 100644
--- a/gtk/gtkmessagedialog.c
+++ b/gtk/gtkmessagedialog.c
@@ -329,10 +329,15 @@ static void
gtk_message_dialog_init (GtkMessageDialog *dialog)
{
GtkWidget *hbox;
+ GtkDialog *message_dialog = GTK_DIALOG (dialog);
+ GtkWidget *action_area, *content_area;
GtkMessageDialogPrivate *priv;
priv = GTK_MESSAGE_DIALOG_GET_PRIVATE (dialog);
+ content_area = gtk_dialog_get_content_area (message_dialog);
+ action_area = gtk_dialog_get_action_area (message_dialog);
+
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_window_set_title (GTK_WINDOW (dialog), "");
gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog), TRUE);
@@ -369,15 +374,15 @@ gtk_message_dialog_init (GtkMessageDialog *dialog)
gtk_box_pack_start (GTK_BOX (hbox), priv->message_area,
TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
+ gtk_box_pack_start (GTK_BOX (content_area),
hbox,
FALSE, FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 14); /* 14 + 2 * 5 = 24 */
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->action_area), 6);
+ gtk_box_set_spacing (GTK_BOX (content_area), 14); /* 14 + 2 * 5 = 24 */
+ gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
+ gtk_box_set_spacing (GTK_BOX (action_area), 6);
gtk_widget_show_all (hbox);
diff --git a/gtk/gtkmountoperation.c b/gtk/gtkmountoperation.c
index 120ee69..e30d13c 100644
--- a/gtk/gtkmountoperation.c
+++ b/gtk/gtkmountoperation.c
@@ -457,6 +457,7 @@ gtk_mount_operation_ask_password (GMountOperation *mount_op,
GtkWidget *hbox, *main_vbox, *vbox, *icon;
GtkWidget *table;
GtkWidget *message_label;
+ GtkWidget *content_area, *action_area;
gboolean can_anonymous;
guint rows;
const gchar *secondary;
@@ -472,12 +473,15 @@ gtk_mount_operation_ask_password (GMountOperation *mount_op,
priv->dialog = dialog;
+ content_area = gtk_dialog_get_content_area (dialog);
+ action_area = gtk_dialog_get_action_area (dialog);
+
/* Set the dialog up with HIG properties */
gtk_dialog_set_has_separator (dialog, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
- gtk_box_set_spacing (GTK_BOX (dialog->vbox), 2); /* 2 * 5 + 2 = 12 */
- gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 5);
- gtk_box_set_spacing (GTK_BOX (dialog->action_area), 6);
+ gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
+ gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
+ gtk_box_set_spacing (GTK_BOX (action_area), 6);
gtk_window_set_resizable (window, FALSE);
gtk_window_set_title (window, "");
@@ -497,7 +501,7 @@ gtk_mount_operation_ask_password (GMountOperation *mount_op,
/* Build contents */
hbox = gtk_hbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
- gtk_box_pack_start (GTK_BOX (dialog->vbox), hbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), hbox, TRUE, TRUE, 0);
icon = gtk_image_new_from_stock (GTK_STOCK_DIALOG_AUTHENTICATION,
GTK_ICON_SIZE_DIALOG);
diff --git a/gtk/gtkpagesetupunixdialog.c b/gtk/gtkpagesetupunixdialog.c
index 7543feb..ff0ed19 100644
--- a/gtk/gtkpagesetupunixdialog.c
+++ b/gtk/gtkpagesetupunixdialog.c
@@ -887,21 +887,25 @@ populate_dialog (GtkPageSetupUnixDialog *ps_dialog)
GtkPageSetupUnixDialogPrivate *priv = ps_dialog->priv;
GtkDialog *dialog = GTK_DIALOG (ps_dialog);
GtkWidget *table, *label, *combo, *radio_button;
+ GtkWidget *action_area, *content_area;
GtkCellRenderer *cell;
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
+ content_area = gtk_dialog_get_content_area (dialog);
+ action_area = gtk_dialog_get_action_area (dialog);
+
gtk_dialog_set_has_separator (dialog, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
- gtk_box_set_spacing (GTK_BOX (dialog->vbox), 2); /* 2 * 5 + 2 = 12 */
- gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 5);
- gtk_box_set_spacing (GTK_BOX (dialog->action_area), 6);
+ gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
+ gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
+ gtk_box_set_spacing (GTK_BOX (action_area), 6);
table = gtk_table_new (5, 4, FALSE);
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
gtk_table_set_col_spacings (GTK_TABLE (table), 12);
gtk_container_set_border_width (GTK_CONTAINER (table), 5);
- gtk_box_pack_start (GTK_BOX (dialog->vbox), table, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), table, TRUE, TRUE, 0);
gtk_widget_show (table);
label = gtk_label_new_with_mnemonic (_("_Format for:"));
diff --git a/gtk/gtkprintbackend.c b/gtk/gtkprintbackend.c
index bdb6a1d..f12f237 100644
--- a/gtk/gtkprintbackend.c
+++ b/gtk/gtkprintbackend.c
@@ -733,6 +733,7 @@ request_password (GtkPrintBackend *backend,
GtkPrintBackendPrivate *priv = backend->priv;
GtkWidget *dialog, *box, *main_box, *label, *icon, *vbox, *entry;
GtkWidget *focus = NULL;
+ GtkWidget *content_area;
gchar *markup;
gint length;
gint i;
@@ -775,7 +776,8 @@ request_password (GtkPrintBackend *backend,
/* Packing */
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), main_box, TRUE, FALSE, 0);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+ gtk_box_pack_start (GTK_BOX (content_area), main_box, TRUE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (main_box), icon, FALSE, FALSE, 6);
gtk_box_pack_start (GTK_BOX (main_box), vbox, FALSE, FALSE, 6);
diff --git a/gtk/gtkprintunixdialog.c b/gtk/gtkprintunixdialog.c
index 757b423..c6d6d0f 100644
--- a/gtk/gtkprintunixdialog.c
+++ b/gtk/gtkprintunixdialog.c
@@ -3768,16 +3768,20 @@ populate_dialog (GtkPrintUnixDialog *print_dialog)
GtkPrintUnixDialogPrivate *priv = print_dialog->priv;
GtkDialog *dialog = GTK_DIALOG (print_dialog);
GtkWidget *vbox, *conflict_hbox, *image, *label;
+ GtkWidget *action_area, *content_area;
+
+ content_area = gtk_dialog_get_content_area (dialog);
+ action_area = gtk_dialog_get_action_area (dialog);
gtk_dialog_set_has_separator (dialog, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
- gtk_box_set_spacing (GTK_BOX (dialog->vbox), 2); /* 2 * 5 + 2 = 12 */
- gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 5);
- gtk_box_set_spacing (GTK_BOX (dialog->action_area), 6);
+ gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
+ gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
+ gtk_box_set_spacing (GTK_BOX (action_area), 6);
vbox = gtk_vbox_new (FALSE, 6);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
- gtk_box_pack_start (GTK_BOX (dialog->vbox), vbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
gtk_widget_show (vbox);
priv->notebook = gtk_notebook_new ();
diff --git a/gtk/gtkrecentchooserdialog.c b/gtk/gtkrecentchooserdialog.c
index e8f5b6b..03de36c 100644
--- a/gtk/gtkrecentchooserdialog.c
+++ b/gtk/gtkrecentchooserdialog.c
@@ -131,6 +131,8 @@ gtk_recent_chooser_dialog_class_init (GtkRecentChooserDialogClass *klass)
static void
gtk_recent_chooser_dialog_init (GtkRecentChooserDialog *dialog)
{
+ GtkWidget *content_area, *action_area;
+
GtkRecentChooserDialogPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (dialog,
GTK_TYPE_RECENT_CHOOSER_DIALOG,
GtkRecentChooserDialogPrivate);
@@ -138,10 +140,13 @@ gtk_recent_chooser_dialog_init (GtkRecentChooserDialog *dialog)
dialog->priv = priv;
+ content_area = gtk_dialog_get_content_area (rc_dialog);
+ action_area = gtk_dialog_get_action_area (rc_dialog);
+
gtk_dialog_set_has_separator (rc_dialog, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (rc_dialog), 5);
- gtk_box_set_spacing (GTK_BOX (rc_dialog->vbox), 2); /* 2 * 5 + 2 = 12 */
- gtk_container_set_border_width (GTK_CONTAINER (rc_dialog->action_area), 5);
+ gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
+ gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
}
@@ -152,15 +157,19 @@ static void
gtk_recent_chooser_item_activated_cb (GtkRecentChooser *chooser,
gpointer user_data)
{
+ GtkDialog *rc_dialog;
GtkRecentChooserDialog *dialog;
+ GtkWidget *action_area;
GList *children, *l;
dialog = GTK_RECENT_CHOOSER_DIALOG (user_data);
+ rc_dialog = GTK_DIALOG (dialog);
if (gtk_window_activate_default (GTK_WINDOW (dialog)))
return;
-
- children = gtk_container_get_children (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area));
+
+ action_area = gtk_dialog_get_action_area (rc_dialog);
+ children = gtk_container_get_children (GTK_CONTAINER (action_area));
for (l = children; l; l = l->next)
{
@@ -168,7 +177,7 @@ gtk_recent_chooser_item_activated_cb (GtkRecentChooser *chooser,
gint response_id;
widget = GTK_WIDGET (l->data);
- response_id = gtk_dialog_get_response_for_widget (GTK_DIALOG (dialog), widget);
+ response_id = gtk_dialog_get_response_for_widget (rc_dialog, widget);
if (response_id == GTK_RESPONSE_ACCEPT ||
response_id == GTK_RESPONSE_OK ||
@@ -191,9 +200,10 @@ gtk_recent_chooser_dialog_constructor (GType type,
guint n_construct_properties,
GObjectConstructParam *construct_params)
{
- GObject *object;
GtkRecentChooserDialogPrivate *priv;
-
+ GtkWidget *content_area;
+ GObject *object;
+
object = G_OBJECT_CLASS (gtk_recent_chooser_dialog_parent_class)->constructor (type,
n_construct_properties,
construct_params);
@@ -212,8 +222,10 @@ gtk_recent_chooser_dialog_constructor (GType type,
G_CALLBACK (gtk_recent_chooser_item_activated_cb),
object);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (object));
+
gtk_container_set_border_width (GTK_CONTAINER (priv->chooser), 5);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (object)->vbox),
+ gtk_box_pack_start (GTK_BOX (content_area),
priv->chooser, TRUE, TRUE, 0);
gtk_widget_show (priv->chooser);
diff --git a/gtk/tests/builder.c b/gtk/tests/builder.c
index d053ed9..b45cc41 100644
--- a/gtk/tests/builder.c
+++ b/gtk/tests/builder.c
@@ -970,6 +970,7 @@ static void
test_children (void)
{
GtkBuilder * builder;
+ GtkWidget *content_area, *dialog_action_area;
GList *children;
const gchar buffer1[] =
"<interface>"
@@ -1023,20 +1024,22 @@ test_children (void)
g_list_free (children);
vbox = gtk_builder_get_object (builder, "dialog1-vbox");
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
g_assert (vbox != NULL);
g_assert (GTK_IS_VBOX (vbox));
g_assert (strcmp (gtk_buildable_get_name (GTK_BUILDABLE (GTK_WIDGET (vbox)->parent)), "dialog1") == 0);
g_assert (gtk_container_get_border_width (GTK_CONTAINER (vbox)) == 10);
- g_assert (strcmp (gtk_buildable_get_name (GTK_BUILDABLE (GTK_DIALOG (dialog)->vbox)), "dialog1-vbox") == 0);
+ g_assert (strcmp (gtk_buildable_get_name (GTK_BUILDABLE (content_area)), "dialog1-vbox") == 0);
action_area = gtk_builder_get_object (builder, "dialog1-action_area");
+ dialog_action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
g_assert (action_area != NULL);
g_assert (GTK_IS_HBUTTON_BOX (action_area));
g_assert (GTK_WIDGET (action_area)->parent != NULL);
g_assert (gtk_container_get_border_width (GTK_CONTAINER (action_area)) == 20);
- g_assert (GTK_DIALOG (dialog)->action_area != NULL);
- g_assert (gtk_buildable_get_name (GTK_BUILDABLE (GTK_DIALOG (dialog)->action_area)) != NULL);
- g_assert (strcmp (gtk_buildable_get_name (GTK_BUILDABLE (GTK_DIALOG (dialog)->action_area)), "dialog1-action_area") == 0);
+ g_assert (dialog_action_area != NULL);
+ g_assert (gtk_buildable_get_name (GTK_BUILDABLE (action_area)) != NULL);
+ g_assert (strcmp (gtk_buildable_get_name (GTK_BUILDABLE (dialog_action_area)), "dialog1-action_area") == 0);
gtk_widget_destroy (GTK_WIDGET (dialog));
g_object_unref (builder);
}
diff --git a/modules/other/gail/tests/testimage.c b/modules/other/gail/tests/testimage.c
index b0c2243..20b7740 100644
--- a/modules/other/gail/tests/testimage.c
+++ b/modules/other/gail/tests/testimage.c
@@ -27,6 +27,7 @@ static void destroy (GtkWidget *widget, gpointer data)
static void _check_arrows (AtkObject *obj)
{
+ GtkWidget *content_area, *action_area;
AtkRole role;
MainDialog *md;
static gint visibleDialog = 0;
@@ -44,26 +45,24 @@ static void _check_arrows (AtkObject *obj)
md->arrow4 = gtk_arrow_new(GTK_ARROW_RIGHT,GTK_SHADOW_OUT);
md->dialog = gtk_dialog_new();
gtk_window_set_modal(GTK_WINDOW(md->dialog), TRUE);
- gtk_box_pack_start(GTK_BOX (GTK_DIALOG (md->dialog)->vbox),
- md->arrow1, TRUE,TRUE, 0);
- gtk_box_pack_start(GTK_BOX (GTK_DIALOG (md->dialog)->vbox),
- md->arrow2, TRUE,TRUE, 0);
- gtk_box_pack_start(GTK_BOX (GTK_DIALOG (md->dialog)->vbox),
- md->arrow3, TRUE,TRUE, 0);
- gtk_box_pack_start(GTK_BOX (GTK_DIALOG (md->dialog)->vbox),
- md->arrow4, TRUE,TRUE, 0);
+
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (md->dialog));
+ action_area = gtk_dialog_get_action_area (GTK_DIALOG (md->dialog));
+
+ gtk_box_pack_start(GTK_BOX (content_area), md->arrow1, TRUE,TRUE, 0);
+ gtk_box_pack_start(GTK_BOX (content_area), md->arrow2, TRUE,TRUE, 0);
+ gtk_box_pack_start(GTK_BOX (content_area), md->arrow3, TRUE,TRUE, 0);
+ gtk_box_pack_start(GTK_BOX (content_area), md->arrow4, TRUE,TRUE, 0);
g_signal_connect(GTK_OBJECT(md->dialog), "destroy",
G_CALLBACK (destroy), md->dialog);
md->image = GTK_IMAGE(gtk_image_new_from_file("circles.xbm"));
- gtk_box_pack_start(GTK_BOX (GTK_DIALOG (md->dialog)->vbox),
- GTK_WIDGET(md->image), TRUE,TRUE, 0);
+ gtk_box_pack_start(GTK_BOX (content_area), GTK_WIDGET(md->image), TRUE,TRUE, 0);
md->close_button = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
g_signal_connect(GTK_OBJECT(md->close_button), "clicked",
G_CALLBACK (destroy), md->dialog);
- gtk_box_pack_start(GTK_BOX (GTK_DIALOG (md->dialog)->action_area),
- md->close_button, TRUE,TRUE, 0);
+ gtk_box_pack_start(GTK_BOX (action_area), md->close_button, TRUE,TRUE, 0);
gtk_widget_show_all(md->dialog);
visibleDialog = 1;
diff --git a/tests/testcombochange.c b/tests/testcombochange.c
index f950150..c3ed117 100644
--- a/tests/testcombochange.c
+++ b/tests/testcombochange.c
@@ -234,6 +234,7 @@ on_animate (void)
int
main (int argc, char **argv)
{
+ GtkWidget *content_area;
GtkWidget *dialog;
GtkWidget *scrolled_window;
GtkWidget *hbox;
@@ -256,10 +257,12 @@ main (int argc, char **argv)
NULL, GTK_DIALOG_NO_SEPARATOR,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
NULL);
-
+
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+
hbox = gtk_hbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), hbox, TRUE, TRUE, 0);
combo_vbox = gtk_vbox_new (FALSE, 8);
gtk_box_pack_start (GTK_BOX (hbox), combo_vbox, FALSE, FALSE, 0);
diff --git a/tests/testfilechooserbutton.c b/tests/testfilechooserbutton.c
index 357bafb..d7db117 100644
--- a/tests/testfilechooserbutton.c
+++ b/tests/testfilechooserbutton.c
@@ -49,10 +49,15 @@ static gchar *gtk_src_dir = NULL;
static void
win_style_set_cb (GtkWidget *win)
{
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (win)->vbox), 12);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (win)->vbox), 24);
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (win)->action_area), 0);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (win)->action_area), 6);
+ GtkWidget *content_area, *action_area;
+
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (win));
+ action_area = gtk_dialog_get_action_area (GTK_DIALOG (win));
+
+ gtk_container_set_border_width (GTK_CONTAINER (content_area), 12);
+ gtk_box_set_spacing (GTK_BOX (content_area), 24);
+ gtk_container_set_border_width (GTK_CONTAINER (action_area), 0);
+ gtk_box_set_spacing (GTK_BOX (action_area), 6);
}
static gboolean
@@ -287,7 +292,7 @@ main (int argc,
g_signal_connect (win, "response", G_CALLBACK (gtk_main_quit), NULL);
vbox = gtk_vbox_new (FALSE, 18);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (win)->vbox), vbox);
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (win))), vbox);
frame = gtk_frame_new ("<b>GtkFileChooserButton</b>");
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 94ac27d..54d2b1b 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -349,6 +349,7 @@ create_alpha_window (GtkWidget *widget)
if (!window)
{
+ GtkWidget *content_area;
GtkWidget *vbox;
GtkWidget *label;
@@ -360,10 +361,12 @@ create_alpha_window (GtkWidget *widget)
gtk_widget_set_app_paintable (window, TRUE);
g_signal_connect (window, "expose-event",
G_CALLBACK (on_alpha_window_expose), NULL);
+
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
vbox = gtk_vbox_new (FALSE, 8);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox,
+ gtk_box_pack_start (GTK_BOX (content_area), vbox,
TRUE, TRUE, 0);
label = gtk_label_new (NULL);
@@ -678,6 +681,7 @@ static void
create_big_windows (GtkWidget *widget)
{
static GtkWidget *window = NULL;
+ GtkWidget *content_area;
GtkWidget *darea, *table, *scrollbar;
GtkWidget *eventbox;
GtkAdjustment *hadj;
@@ -709,9 +713,10 @@ create_big_windows (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy),
NULL);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
+
table = gtk_table_new (2, 2, FALSE);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox),
- table, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), table, TRUE, TRUE, 0);
darea = gtk_drawing_area_new ();
@@ -1050,7 +1055,7 @@ create_check_buttons (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy),
NULL);
- box1 = GTK_DIALOG (window)->vbox;
+ box1 = gtk_dialog_get_content_area (GTK_DIALOG (window));
box2 = gtk_vbox_new (FALSE, 10);
gtk_container_set_border_width (GTK_CONTAINER (box2), 10);
@@ -1115,7 +1120,7 @@ create_radio_buttons (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy),
NULL);
- box1 = GTK_DIALOG (window)->vbox;
+ box1 = gtk_dialog_get_content_area (GTK_DIALOG (window));
box2 = gtk_vbox_new (FALSE, 10);
gtk_container_set_border_width (GTK_CONTAINER (box2), 10);
@@ -1815,6 +1820,7 @@ gridded_geometry_response (GtkDialog *dialog,
{
gchar *geometry_string = g_strdup (gtk_entry_get_text (entry));
gchar *title = g_strdup_printf ("Gridded window at: %s", geometry_string);
+ GtkWidget *content_area;
GtkWidget *window;
GtkWidget *drawing_area;
GtkWidget *box;
@@ -1832,8 +1838,10 @@ gridded_geometry_response (GtkDialog *dialog,
g_signal_connect (window, "response",
G_CALLBACK (gridded_geometry_subresponse), geometry_string);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
+
box = gtk_vbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), box, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), box, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (box), 7);
@@ -1877,6 +1885,7 @@ create_gridded_geometry (GtkWidget *widget)
{
static GtkWidget *window = NULL;
gpointer window_ptr;
+ GtkWidget *content_area;
GtkWidget *entry;
GtkWidget *label;
@@ -1891,12 +1900,14 @@ create_gridded_geometry (GtkWidget *widget)
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (widget));
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
+
label = gtk_label_new ("Geometry string:");
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), label, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), label, FALSE, FALSE, 0);
entry = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (entry), DEFAULT_GEOMETRY);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), entry, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), entry, FALSE, FALSE, 0);
g_signal_connect (window, "response",
G_CALLBACK (gridded_geometry_response), entry);
@@ -2652,6 +2663,7 @@ static void
create_rotated_label (GtkWidget *widget)
{
static GtkWidget *window = NULL;
+ GtkWidget *content_area;
GtkWidget *vbox;
GtkWidget *hscale;
GtkWidget *label;
@@ -2675,8 +2687,10 @@ create_rotated_label (GtkWidget *widget)
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
+
vbox = gtk_vbox_new (FALSE, 5);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 10);
label = gtk_label_new (NULL);
@@ -2811,6 +2825,7 @@ create_rotated_text (GtkWidget *widget)
{
const GdkColor white = { 0, 0xffff, 0xffff, 0xffff };
GtkRequisition requisition;
+ GtkWidget *content_area;
GtkWidget *drawing_area;
GdkPixbuf *tile_pixbuf;
@@ -2829,8 +2844,10 @@ create_rotated_text (GtkWidget *widget)
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
+
drawing_area = gtk_drawing_area_new ();
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), drawing_area, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), drawing_area, TRUE, TRUE, 0);
gtk_widget_modify_bg (drawing_area, GTK_STATE_NORMAL, &white);
tile_pixbuf = gdk_pixbuf_new_from_file ("marble.xpm", NULL);
@@ -4066,7 +4083,8 @@ create_key_lookup (GtkWidget *widget)
{
GtkAccelGroup *accel_group = gtk_accel_group_new ();
GtkWidget *button;
-
+ GtkWidget *content_area;
+
window = gtk_dialog_new_with_buttons ("Key Lookup", NULL, 0,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
NULL);
@@ -4079,35 +4097,37 @@ create_key_lookup (GtkWidget *widget)
gtk_window_set_default_size (GTK_WINDOW (window), 300, -1);
gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
+
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
button = gtk_button_new_with_mnemonic ("Button 1 (_a)");
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), button, FALSE, FALSE, 0);
button = gtk_button_new_with_mnemonic ("Button 2 (_A)");
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), button, FALSE, FALSE, 0);
button = gtk_button_new_with_mnemonic ("Button 3 (_\321\204)");
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), button, FALSE, FALSE, 0);
button = gtk_button_new_with_mnemonic ("Button 4 (_\320\244)");
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), button, FALSE, FALSE, 0);
button = gtk_button_new_with_mnemonic ("Button 6 (_b)");
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), button, FALSE, FALSE, 0);
button = accel_button_new (accel_group, "Button 7", "<Alt><Shift>b");
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), button, FALSE, FALSE, 0);
button = accel_button_new (accel_group, "Button 8", "<Alt>d");
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), button, FALSE, FALSE, 0);
button = accel_button_new (accel_group, "Button 9", "<Alt>Cyrillic_ve");
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), button, FALSE, FALSE, 0);
button = gtk_button_new_with_mnemonic ("Button 10 (_1)");
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), button, FALSE, FALSE, 0);
button = gtk_button_new_with_mnemonic ("Button 11 (_!)");
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), button, FALSE, FALSE, 0);
button = accel_button_new (accel_group, "Button 12", "<Super>a");
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), button, FALSE, FALSE, 0);
button = accel_button_new (accel_group, "Button 13", "<Hyper>a");
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), button, FALSE, FALSE, 0);
button = accel_button_new (accel_group, "Button 14", "<Meta>a");
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), button, FALSE, FALSE, 0);
button = accel_button_new (accel_group, "Button 15", "<Shift><Mod4>b");
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), button, FALSE, FALSE, 0);
window_ptr = &window;
g_object_add_weak_pointer (G_OBJECT (window), window_ptr);
@@ -4375,6 +4395,7 @@ static void
create_scrolled_windows (GtkWidget *widget)
{
static GtkWidget *window;
+ GtkWidget *content_area, *action_area;
GtkWidget *scrolled_window;
GtkWidget *table;
GtkWidget *button;
@@ -4392,17 +4413,18 @@ create_scrolled_windows (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroyed),
&window);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
+ action_area = gtk_dialog_get_action_area (GTK_DIALOG (window));
+
gtk_window_set_title (GTK_WINDOW (window), "dialog");
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
-
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_container_set_border_width (GTK_CONTAINER (scrolled_window), 10);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox),
- scrolled_window, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), scrolled_window, TRUE, TRUE, 0);
gtk_widget_show (scrolled_window);
table = gtk_table_new (20, 20, FALSE);
@@ -4431,8 +4453,7 @@ create_scrolled_windows (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy),
window);
gtk_widget_set_can_default (button, TRUE);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
- button, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (action_area), button, TRUE, TRUE, 0);
gtk_widget_grab_default (button);
gtk_widget_show (button);
@@ -4441,8 +4462,7 @@ create_scrolled_windows (GtkWidget *widget)
G_CALLBACK (scrolled_windows_remove),
scrolled_window);
gtk_widget_set_can_default (button, TRUE);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
- button, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (action_area), button, TRUE, TRUE, 0);
gtk_widget_grab_default (button);
gtk_widget_show (button);
@@ -4853,6 +4873,7 @@ static GtkWidget *
create_size_group_window (GdkScreen *screen,
GtkSizeGroup *master_size_group)
{
+ GtkWidget *content_area;
GtkWidget *window;
GtkWidget *table;
GtkWidget *main_button;
@@ -4878,8 +4899,10 @@ create_size_group_window (GdkScreen *screen,
G_CALLBACK (gtk_widget_destroy),
NULL);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
+
table = gtk_table_new (2, 2, FALSE);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), table, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), table, TRUE, TRUE, 0);
gtk_table_set_row_spacings (GTK_TABLE (table), 5);
gtk_table_set_col_spacings (GTK_TABLE (table), 5);
@@ -4934,7 +4957,7 @@ create_size_group_window (GdkScreen *screen,
g_object_unref (vgroup2);
hbox = gtk_hbox_new (FALSE, 5);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), hbox, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), hbox, FALSE, FALSE, 0);
spin_button = gtk_spin_button_new_with_range (1, 100, 1);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin_button), SIZE_GROUP_INITIAL_SIZE);
@@ -5773,7 +5796,12 @@ orientable_toggle_orientation (GtkOrientable *orientable)
void
flipping_orientation_toggled_cb (GtkWidget *widget, gpointer data)
{
- orientable_toggle_orientation (GTK_ORIENTABLE (GTK_DIALOG (gtk_widget_get_toplevel (widget))->vbox));
+ GtkWidget *content_area;
+ GtkWidget *toplevel;
+
+ toplevel = gtk_widget_get_toplevel (widget);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (toplevel));
+ orientable_toggle_orientation (GTK_ORIENTABLE (content_area));
}
static void
@@ -5814,6 +5842,7 @@ create_flipping (GtkWidget *widget)
{
static GtkWidget *window = NULL;
GtkWidget *check_button, *button;
+ GtkWidget *action_area, *content_area;
if (!window)
{
@@ -5826,12 +5855,14 @@ create_flipping (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroyed),
&window);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
+ action_area = gtk_dialog_get_action_area (GTK_DIALOG (window));
+
gtk_window_set_title (GTK_WINDOW (window), "Bidirectional Flipping");
check_button = gtk_check_button_new_with_label ("Right-to-left global direction");
gtk_container_set_border_width (GTK_CONTAINER (check_button), 10);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox),
- check_button, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), check_button, TRUE, TRUE, 0);
if (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button), TRUE);
@@ -5841,29 +5872,27 @@ create_flipping (GtkWidget *widget)
check_button = gtk_check_button_new_with_label ("Toggle orientation of all boxes");
gtk_container_set_border_width (GTK_CONTAINER (check_button), 10);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox),
- check_button, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), check_button, TRUE, TRUE, 0);
g_signal_connect (check_button, "toggled",
G_CALLBACK (flipping_orientation_toggled_cb), NULL);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox),
+ gtk_box_pack_start (GTK_BOX (content_area),
create_forward_back ("Default", GTK_TEXT_DIR_NONE),
TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox),
+ gtk_box_pack_start (GTK_BOX (content_area),
create_forward_back ("Left-to-Right", GTK_TEXT_DIR_LTR),
TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox),
+ gtk_box_pack_start (GTK_BOX (content_area),
create_forward_back ("Right-to-Left", GTK_TEXT_DIR_RTL),
TRUE, TRUE, 0);
button = gtk_button_new_with_label ("Close");
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy), window);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
- button, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (action_area), button, TRUE, TRUE, 0);
}
if (!gtk_widget_get_visible (window))
@@ -5927,6 +5956,7 @@ create_focus (GtkWidget *widget)
if (!window)
{
+ GtkWidget *content_area;
GtkWidget *table;
GtkWidget *frame;
GList *list = NULL;
@@ -5947,13 +5977,14 @@ create_focus (GtkWidget *widget)
g_signal_connect (window, "response",
G_CALLBACK (gtk_widget_destroy),
NULL);
+
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
gtk_window_set_title (GTK_WINDOW (window), "Keyboard Focus Navigation");
frame = gtk_frame_new ("Weird tab focus chain");
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox),
- frame, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), frame, TRUE, TRUE, 0);
table = make_focus_table (&list);
@@ -5966,8 +5997,7 @@ create_focus (GtkWidget *widget)
frame = gtk_frame_new ("Default tab focus chain");
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox),
- frame, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), frame, TRUE, TRUE, 0);
list = NULL;
table = make_focus_table (&list);
@@ -6056,7 +6086,7 @@ label_toggle (GtkWidget *widget,
G_CALLBACK (gtk_widget_destroyed),
label);
gtk_misc_set_padding (GTK_MISC (*label), 10, 10);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog_window)->vbox),
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog_window))),
*label, TRUE, TRUE, 0);
gtk_widget_show (*label);
}
@@ -6084,6 +6114,7 @@ static void
create_dialog (GtkWidget *widget)
{
static GtkWidget *label;
+ GtkWidget *action_area;
GtkWidget *button;
if (!dialog_window)
@@ -6106,13 +6137,14 @@ create_dialog (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroyed),
&dialog_window);
+ action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog_window));
+
gtk_window_set_title (GTK_WINDOW (dialog_window), "GtkDialog");
gtk_container_set_border_width (GTK_CONTAINER (dialog_window), 0);
button = gtk_button_new_with_label ("OK");
gtk_widget_set_can_default (button, TRUE);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog_window)->action_area),
- button, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (action_area), button, TRUE, TRUE, 0);
gtk_widget_grab_default (button);
gtk_widget_show (button);
@@ -6121,8 +6153,7 @@ create_dialog (GtkWidget *widget)
G_CALLBACK (label_toggle),
&label);
gtk_widget_set_can_default (button, TRUE);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog_window)->action_area),
- button, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (action_area), button, TRUE, TRUE, 0);
gtk_widget_show (button);
label = NULL;
@@ -6355,6 +6386,7 @@ event_watcher_toggle (void)
static void
create_event_watcher (GtkWidget *widget)
{
+ GtkWidget *action_area, *content_area;
GtkWidget *button;
if (!dialog_window)
@@ -6370,6 +6402,9 @@ create_event_watcher (GtkWidget *widget)
G_CALLBACK (event_watcher_down),
NULL);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog_window));
+ action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog_window));
+
gtk_window_set_title (GTK_WINDOW (dialog_window), "Event Watcher");
gtk_container_set_border_width (GTK_CONTAINER (dialog_window), 0);
gtk_widget_set_size_request (dialog_window, 200, 110);
@@ -6379,8 +6414,7 @@ create_event_watcher (GtkWidget *widget)
G_CALLBACK (event_watcher_toggle),
NULL);
gtk_container_set_border_width (GTK_CONTAINER (button), 10);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog_window)->vbox),
- button, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), button, TRUE, TRUE, 0);
gtk_widget_show (button);
button = gtk_button_new_with_label ("Close");
@@ -6388,8 +6422,7 @@ create_event_watcher (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy),
dialog_window);
gtk_widget_set_can_default (button, TRUE);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog_window)->action_area),
- button, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (action_area), button, TRUE, TRUE, 0);
gtk_widget_grab_default (button);
gtk_widget_show (button);
}
@@ -8947,6 +8980,7 @@ entry_changed (GtkWidget *widget, ProgressData *pdata)
void
create_progress_bar (GtkWidget *widget)
{
+ GtkWidget *action_area, *content_area;
GtkWidget *button;
GtkWidget *vbox;
GtkWidget *vbox2;
@@ -8988,16 +9022,17 @@ create_progress_bar (GtkWidget *widget)
g_signal_connect (pdata->window, "destroy",
G_CALLBACK (destroy_progress),
&pdata);
-
pdata->timer = 0;
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (pdata->window));
+ action_area = gtk_dialog_get_action_area (GTK_DIALOG (pdata->window));
+
gtk_window_set_title (GTK_WINDOW (pdata->window), "GtkProgressBar");
gtk_container_set_border_width (GTK_CONTAINER (pdata->window), 0);
vbox = gtk_vbox_new (FALSE, 5);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 10);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (pdata->window)->vbox),
- vbox, FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), vbox, FALSE, TRUE, 0);
frame = gtk_frame_new ("Progress");
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0);
@@ -9100,8 +9135,7 @@ create_progress_bar (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy),
pdata->window);
gtk_widget_set_can_default (button, TRUE);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (pdata->window)->action_area),
- button, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (action_area), button, TRUE, TRUE, 0);
gtk_widget_grab_default (button);
}
@@ -9623,6 +9657,7 @@ void
create_selection_test (GtkWidget *widget)
{
static GtkWidget *window = NULL;
+ GtkWidget *action_area, *content_area;
GtkWidget *button;
GtkWidget *vbox;
GtkWidget *scrolled_win;
@@ -9643,6 +9678,9 @@ create_selection_test (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroyed),
&window);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
+ action_area = gtk_dialog_get_action_area (GTK_DIALOG (window));
+
gtk_window_set_title (GTK_WINDOW (window), "Selection Test");
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
@@ -9650,8 +9688,7 @@ create_selection_test (GtkWidget *widget)
vbox = gtk_vbox_new (FALSE, 5);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 10);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox,
- TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
label = gtk_label_new ("Gets available targets for current selection");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
@@ -9677,15 +9714,13 @@ create_selection_test (GtkWidget *widget)
/* .. And create some buttons */
button = gtk_button_new_with_label ("Get Targets");
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
- button, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (action_area), button, TRUE, TRUE, 0);
g_signal_connect (button, "clicked",
G_CALLBACK (selection_test_get_targets), tree_view);
button = gtk_button_new_with_label ("Quit");
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
- button, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (action_area), button, TRUE, TRUE, 0);
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy),
@@ -9775,6 +9810,7 @@ void
create_scroll_test (GtkWidget *widget)
{
static GtkWidget *window = NULL;
+ GtkWidget *action_area, *content_area;
GtkWidget *hbox;
GtkWidget *drawing_area;
GtkWidget *scrollbar;
@@ -9794,12 +9830,14 @@ create_scroll_test (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroyed),
&window);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
+ action_area = gtk_dialog_get_action_area (GTK_DIALOG (window));
+
gtk_window_set_title (GTK_WINDOW (window), "Scroll Test");
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
hbox = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), hbox,
- TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), hbox, TRUE, TRUE, 0);
gtk_widget_show (hbox);
drawing_area = gtk_drawing_area_new ();
@@ -9830,8 +9868,7 @@ create_scroll_test (GtkWidget *widget)
/* .. And create some buttons */
button = gtk_button_new_with_label ("Quit");
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
- button, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (action_area), button, TRUE, TRUE, 0);
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy),
@@ -9913,6 +9950,7 @@ void
create_timeout_test (GtkWidget *widget)
{
static GtkWidget *window = NULL;
+ GtkWidget *action_area, *content_area;
GtkWidget *button;
GtkWidget *label;
@@ -9927,13 +9965,15 @@ create_timeout_test (GtkWidget *widget)
G_CALLBACK (destroy_timeout_test),
&window);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
+ action_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
+
gtk_window_set_title (GTK_WINDOW (window), "Timeout Test");
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
label = gtk_label_new ("count: 0");
gtk_misc_set_padding (GTK_MISC (label), 10, 10);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox),
- label, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), label, TRUE, TRUE, 0);
gtk_widget_show (label);
button = gtk_button_new_with_label ("close");
@@ -9941,8 +9981,7 @@ create_timeout_test (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy),
window);
gtk_widget_set_can_default (button, TRUE);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
- button, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (action_area), button, TRUE, TRUE, 0);
gtk_widget_grab_default (button);
gtk_widget_show (button);
@@ -9951,8 +9990,7 @@ create_timeout_test (GtkWidget *widget)
G_CALLBACK(start_timeout_test),
label);
gtk_widget_set_can_default (button, TRUE);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
- button, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (action_area), button, TRUE, TRUE, 0);
gtk_widget_show (button);
button = gtk_button_new_with_label ("stop");
@@ -9960,8 +9998,7 @@ create_timeout_test (GtkWidget *widget)
G_CALLBACK (stop_timeout_test),
NULL);
gtk_widget_set_can_default (button, TRUE);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
- button, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (action_area), button, TRUE, TRUE, 0);
gtk_widget_show (button);
}
@@ -10036,6 +10073,7 @@ create_idle_test (GtkWidget *widget)
if (!window)
{
+ GtkWidget *action_area, *content_area;
GtkWidget *button2;
GtkWidget *frame;
GtkWidget *box;
@@ -10049,6 +10087,9 @@ create_idle_test (GtkWidget *widget)
G_CALLBACK (destroy_idle_test),
&window);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
+ action_area = gtk_dialog_get_action_area (GTK_DIALOG (window));
+
gtk_window_set_title (GTK_WINDOW (window), "Idle Test");
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
@@ -10065,15 +10106,14 @@ create_idle_test (GtkWidget *widget)
"child", label,
/* NULL), */
NULL);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox),
- container, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), container, TRUE, TRUE, 0);
frame =
g_object_new (GTK_TYPE_FRAME,
"border_width", 5,
"label", "Label Container",
"visible", TRUE,
- "parent", GTK_DIALOG (window)->vbox,
+ "parent", content_area,
NULL);
box =
g_object_new (GTK_TYPE_VBOX,
@@ -10117,8 +10157,7 @@ create_idle_test (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy),
window);
gtk_widget_set_can_default (button, TRUE);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
- button, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (action_area), button, TRUE, TRUE, 0);
gtk_widget_grab_default (button);
gtk_widget_show (button);
@@ -10127,8 +10166,7 @@ create_idle_test (GtkWidget *widget)
G_CALLBACK (start_idle_test),
label);
gtk_widget_set_can_default (button, TRUE);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
- button, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (action_area), button, TRUE, TRUE, 0);
gtk_widget_show (button);
button = gtk_button_new_with_label ("stop");
@@ -10136,8 +10174,7 @@ create_idle_test (GtkWidget *widget)
G_CALLBACK (stop_idle_test),
NULL);
gtk_widget_set_can_default (button, TRUE);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
- button, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (action_area), button, TRUE, TRUE, 0);
gtk_widget_show (button);
}
@@ -10175,6 +10212,7 @@ void
create_rc_file (GtkWidget *widget)
{
static GtkWidget *window = NULL;
+ GtkWidget *action_area, *content_area;
GtkWidget *button;
GtkWidget *frame;
GtkWidget *vbox;
@@ -10191,8 +10229,11 @@ create_rc_file (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroyed),
&window);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
+ action_area = gtk_dialog_get_action_area (GTK_DIALOG (window));
+
frame = gtk_aspect_frame_new ("Testing RC file prioritization", 0.5, 0.5, 0.0, TRUE);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), frame, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), frame, FALSE, FALSE, 0);
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (frame), vbox);
@@ -10216,24 +10257,21 @@ create_rc_file (GtkWidget *widget)
g_signal_connect (button, "clicked",
G_CALLBACK (gtk_rc_reparse_all), NULL);
gtk_widget_set_can_default (button, TRUE);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
- button, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (action_area), button, TRUE, TRUE, 0);
gtk_widget_grab_default (button);
button = gtk_button_new_with_label ("Reload All");
g_signal_connect (button, "clicked",
G_CALLBACK (reload_all_rc_files), NULL);
gtk_widget_set_can_default (button, TRUE);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
- button, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (action_area), button, TRUE, TRUE, 0);
button = gtk_button_new_with_label ("Close");
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy),
window);
gtk_widget_set_can_default (button, TRUE);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
- button, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (action_area), button, TRUE, TRUE, 0);
}
if (!gtk_widget_get_visible (window))
@@ -10257,6 +10295,7 @@ void
create_mainloop (GtkWidget *widget)
{
static GtkWidget *window = NULL;
+ GtkWidget *action_area, *content_area;
GtkWidget *label;
GtkWidget *button;
@@ -10273,16 +10312,17 @@ create_mainloop (GtkWidget *widget)
G_CALLBACK (mainloop_destroyed),
&window);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
+ action_area = gtk_dialog_get_action_area (GTK_DIALOG (window));
+
label = gtk_label_new ("In recursive main loop...");
gtk_misc_set_padding (GTK_MISC(label), 20, 20);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), label,
- TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), label, TRUE, TRUE, 0);
gtk_widget_show (label);
button = gtk_button_new_with_label ("Leave");
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area), button,
- FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (action_area), button, FALSE, TRUE, 0);
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy),
@@ -10420,6 +10460,7 @@ void
create_styles (GtkWidget *widget)
{
static GtkWidget *window = NULL;
+ GtkWidget *content_area, *action_area;
GtkWidget *label;
GtkWidget *button;
GtkWidget *entry;
@@ -10443,19 +10484,20 @@ create_styles (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroyed),
&window);
-
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
+ action_area = gtk_dialog_get_action_area (GTK_DIALOG (window));
+
button = gtk_button_new_with_label ("Close");
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy),
window);
gtk_widget_set_can_default (button, TRUE);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
- button, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (action_area), button, TRUE, TRUE, 0);
gtk_widget_show (button);
vbox = gtk_vbox_new (FALSE, 5);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 10);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), vbox, FALSE, FALSE, 0);
label = gtk_label_new ("Font:");
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
diff --git a/tests/testmultidisplay.c b/tests/testmultidisplay.c
index ad96216..9f95526 100644
--- a/tests/testmultidisplay.c
+++ b/tests/testmultidisplay.c
@@ -58,6 +58,7 @@ make_selection_dialog (GdkScreen * screen,
GtkWidget * other_entry)
{
GtkWidget *window, *vbox;
+ GtkWidget *content_area;
MyDoubleGtkEntry *double_entry = g_new (MyDoubleGtkEntry, 1);
double_entry->e1 = GTK_ENTRY (entry);
double_entry->e2 = GTK_ENTRY (other_entry);
@@ -74,11 +75,12 @@ make_selection_dialog (GdkScreen * screen,
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_main_quit), NULL);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
vbox = g_object_new (GTK_TYPE_VBOX,
"border_width", 5,
NULL);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), vbox, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0);
gtk_widget_grab_focus (entry);
@@ -100,6 +102,7 @@ main (int argc, char *argv[])
{
GtkWidget *dialog, *display_entry, *dialog_label;
GtkWidget *entry, *entry2;
+ GtkWidget *content_area;
GdkDisplay *dpy2;
GdkScreen *scr2 = NULL; /* Quiet GCC */
gboolean correct_second_display = FALSE;
@@ -123,9 +126,10 @@ main (int argc, char *argv[])
dialog_label =
gtk_label_new ("Please enter the name of\nthe second 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);
g_signal_connect (dialog, "response",
G_CALLBACK (get_screen_response), display_entry);
diff --git a/tests/testselection.c b/tests/testselection.c
index 3af0c9f..77ac345 100644
--- a/tests/testselection.c
+++ b/tests/testselection.c
@@ -376,6 +376,7 @@ quit (void)
int
main (int argc, char *argv[])
{
+ GtkWidget *action_area, *content_area;
GtkWidget *dialog;
GtkWidget *button;
GtkWidget *table;
@@ -404,6 +405,9 @@ main (int argc, char *argv[])
g_signal_connect (dialog, "destroy",
G_CALLBACK (quit), NULL);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+ action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
+
table = gtk_table_new (4, 2, FALSE);
gtk_container_set_border_width (GTK_CONTAINER(table), 10);
@@ -411,8 +415,7 @@ main (int argc, char *argv[])
gtk_table_set_row_spacing (GTK_TABLE (table), 1, 2);
gtk_table_set_row_spacing (GTK_TABLE (table), 2, 2);
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 2);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG(dialog)->vbox),
- table, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), table, TRUE, TRUE, 0);
gtk_widget_show (table);
selection_button = gtk_toggle_button_new_with_label ("Claim Selection");
@@ -454,15 +457,13 @@ main (int argc, char *argv[])
/* .. And create some buttons */
button = gtk_button_new_with_label ("Paste");
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG(dialog)->action_area),
- button, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (action_area), button, TRUE, TRUE, 0);
g_signal_connect (button, "clicked",
G_CALLBACK (paste), entry);
gtk_widget_show (button);
button = gtk_button_new_with_label ("Quit");
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG(dialog)->action_area),
- button, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (action_area), button, TRUE, TRUE, 0);
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy), dialog);
diff --git a/tests/teststatusicon.c b/tests/teststatusicon.c
index 4829bf0..942a4a5 100755
--- a/tests/teststatusicon.c
+++ b/tests/teststatusicon.c
@@ -143,6 +143,7 @@ timeout_toggle_toggled (GtkToggleButton *toggle)
static void
icon_activated (GtkStatusIcon *icon)
{
+ GtkWidget *content_area;
GtkWidget *dialog;
GtkWidget *toggle;
@@ -165,8 +166,10 @@ icon_activated (GtkStatusIcon *icon)
g_signal_connect (dialog, "delete_event",
G_CALLBACK (gtk_widget_hide_on_delete), NULL);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+
toggle = gtk_toggle_button_new_with_mnemonic ("_Show the icon");
- gtk_box_pack_end (GTK_BOX (GTK_DIALOG (dialog)->vbox), toggle, TRUE, TRUE, 6);
+ gtk_box_pack_end (GTK_BOX (content_area), toggle, TRUE, TRUE, 6);
gtk_widget_show (toggle);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
@@ -175,7 +178,7 @@ icon_activated (GtkStatusIcon *icon)
G_CALLBACK (visible_toggle_toggled), NULL);
toggle = gtk_toggle_button_new_with_mnemonic ("_Blink the icon");
- gtk_box_pack_end (GTK_BOX (GTK_DIALOG (dialog)->vbox), toggle, TRUE, TRUE, 6);
+ gtk_box_pack_end (GTK_BOX (content_area), toggle, TRUE, TRUE, 6);
gtk_widget_show (toggle);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
@@ -184,7 +187,7 @@ icon_activated (GtkStatusIcon *icon)
G_CALLBACK (blink_toggle_toggled), NULL);
toggle = gtk_toggle_button_new_with_mnemonic ("_Change images");
- gtk_box_pack_end (GTK_BOX (GTK_DIALOG (dialog)->vbox), toggle, TRUE, TRUE, 6);
+ gtk_box_pack_end (GTK_BOX (content_area), toggle, TRUE, TRUE, 6);
gtk_widget_show (toggle);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]