Commit 7f2cc85d authored by Javier Jardón's avatar Javier Jardón

Use accessor functions to access GtkDialog

parent 80df961e
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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.");
......
......@@ -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);
......
......@@ -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);
......
......@@ -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 */
......
......@@ -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,
......
......@@ -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);
......
......@@ -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);
}
......
......@@ -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,
......
......@@ -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);
......
......@@ -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);
......
......@@ -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:"));
......
......@@ -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);
......
......@@ -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 ();
......
......@@ -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);
......
......@@ -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);
}
......
......@@ -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;
......
......@@ -234,6 +234,7 @@ on_animate (void)
int
main (int argc, char **argv)