Stop using gtk_box_pack_end

It might soon go away!
This commit is contained in:
Timm Bäder 2018-12-26 08:20:34 +01:00 committed by Matthias Clasen
parent 09361e7665
commit bd71e744d2
81 changed files with 869 additions and 872 deletions

View File

@ -73,7 +73,7 @@ do_expander (GtkWidget *do_widget)
"resize the window. Do it already !", -1);
gtk_container_add (GTK_CONTAINER (sw), tv);
gtk_container_add (GTK_CONTAINER (expander), sw);
gtk_box_pack_end (GTK_BOX (area), expander);
gtk_container_add (GTK_CONTAINER (area), expander);
g_signal_connect (expander, "notify::expanded",
G_CALLBACK (expander_cb), window);

View File

@ -991,7 +991,7 @@ create_statusbar (void)
gtk_widget_set_halign (widget, GTK_ALIGN_FILL);
gtk_statusbar_push (GTK_STATUSBAR (widget), 0, "Hold on...");
gtk_box_pack_end (GTK_BOX (vbox), widget);
gtk_container_add (GTK_CONTAINER (vbox), widget);
info = new_widget_info ("statusbar", vbox, SMALL);
@ -1074,7 +1074,7 @@ create_volume_button (void)
gtk_container_add (GTK_CONTAINER (widget), box);
button = gtk_volume_button_new ();
gtk_box_pack_end (GTK_BOX (box), button);
gtk_container_add (GTK_CONTAINER (box), button);
gtk_scale_button_set_value (GTK_SCALE_BUTTON (button), 33);
popup = gtk_scale_button_get_popup (GTK_SCALE_BUTTON (button));

View File

@ -210,7 +210,8 @@ gtk_action_bar_set_child_property (GtkContainer *container,
{
g_object_ref (child);
gtk_container_remove (GTK_CONTAINER (priv->start_box), child);
gtk_box_pack_end (GTK_BOX (priv->end_box), child);
gtk_container_add (GTK_CONTAINER (priv->end_box), child);
gtk_box_reorder_child (GTK_BOX (priv->end_box), child, 0);
g_object_unref (child);
}
}
@ -478,7 +479,8 @@ gtk_action_bar_pack_end (GtkActionBar *action_bar,
{
GtkActionBarPrivate *priv = gtk_action_bar_get_instance_private (action_bar);
gtk_box_pack_end (GTK_BOX (priv->end_box), child);
gtk_container_add (GTK_CONTAINER (priv->end_box), child);
gtk_box_reorder_child (GTK_BOX (priv->end_box), child, 0);
}
/**

View File

@ -338,7 +338,7 @@ construct_appchooser_widget (GtkAppChooserDialog *self)
/* Need to build the appchooser widget after, because of the content-type construct-only property */
self->priv->app_chooser_widget = gtk_app_chooser_widget_new (self->priv->content_type);
gtk_widget_set_vexpand (self->priv->app_chooser_widget, TRUE);
gtk_box_pack_start (GTK_BOX (self->priv->inner_box), self->priv->app_chooser_widget);
gtk_container_add (GTK_CONTAINER (self->priv->inner_box), self->priv->app_chooser_widget);
g_signal_connect (self->priv->app_chooser_widget, "application-selected",
@ -351,10 +351,10 @@ construct_appchooser_widget (GtkAppChooserDialog *self)
G_CALLBACK (widget_populate_popup_cb), self);
/* Add the custom button to the new appchooser */
gtk_box_pack_start (GTK_BOX (self->priv->inner_box),
gtk_container_add (GTK_CONTAINER (self->priv->inner_box),
self->priv->show_more_button);
gtk_box_pack_start (GTK_BOX (self->priv->inner_box),
gtk_container_add (GTK_CONTAINER (self->priv->inner_box),
self->priv->software_button);
info = gtk_app_chooser_get_app_info (GTK_APP_CHOOSER (self->priv->app_chooser_widget));

View File

@ -1686,14 +1686,14 @@ gtk_assistant_insert_page (GtkAssistant *assistant,
priv->pages = g_list_insert (priv->pages, page_info, position);
gtk_box_pack_start (GTK_BOX (priv->sidebar), page_info->regular_title);
gtk_box_pack_start (GTK_BOX (priv->sidebar), page_info->current_title);
gtk_container_add (GTK_CONTAINER (priv->sidebar), page_info->regular_title);
gtk_container_add (GTK_CONTAINER (priv->sidebar), page_info->current_title);
gtk_box_reorder_child (GTK_BOX (priv->sidebar), page_info->regular_title, 2 * position);
gtk_box_reorder_child (GTK_BOX (priv->sidebar), page_info->current_title, 2 * position + 1);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_show (box);
gtk_box_pack_start (GTK_BOX (box), page);
gtk_container_add (GTK_CONTAINER (box), page);
g_object_set (box, "margin", 12, NULL);
g_signal_connect (box, "remove", G_CALLBACK (assistant_remove_page_cb), assistant);
@ -1792,7 +1792,7 @@ add_to_action_area (GtkAssistant *assistant,
gtk_widget_set_valign (child, GTK_ALIGN_BASELINE);
gtk_box_pack_end (GTK_BOX (priv->action_area), child);
gtk_container_add (GTK_CONTAINER (priv->action_area), child);
}
/**

View File

@ -118,13 +118,6 @@ static void gtk_button_box_get_child_property (GtkContainer *container,
G_DEFINE_TYPE_WITH_PRIVATE (GtkButtonBox, gtk_button_box, GTK_TYPE_BOX)
static void
gtk_button_box_add (GtkContainer *container,
GtkWidget *widget)
{
gtk_box_pack_start (GTK_BOX (container), widget);
}
static void
gtk_button_box_class_init (GtkButtonBoxClass *class)
{
@ -143,7 +136,6 @@ gtk_button_box_class_init (GtkButtonBoxClass *class)
widget_class->size_allocate = gtk_button_box_size_allocate;
container_class->remove = gtk_button_box_remove;
container_class->add = gtk_button_box_add;
container_class->set_child_property = gtk_button_box_set_child_property;
container_class->get_child_property = gtk_button_box_get_child_property;

View File

@ -531,14 +531,14 @@ gtk_color_chooser_widget_init (GtkColorChooserWidget *cc)
add_default_palette (cc);
cc->priv->custom = box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
g_object_set (box, "margin-top", 12, NULL);
gtk_box_pack_end (GTK_BOX (cc->priv->palette), box);
/* translators: label for the custom section in the color chooser */
cc->priv->custom_label = label = gtk_label_new (_("Custom"));
gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_box_pack_end (GTK_BOX (cc->priv->palette), label);
gtk_container_add (GTK_CONTAINER (cc->priv->palette), label);
cc->priv->custom = box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
g_object_set (box, "margin-top", 12, NULL);
gtk_container_add (GTK_CONTAINER (cc->priv->palette), box);
cc->priv->button = button = gtk_color_swatch_new ();
gtk_widget_set_name (button, "add-color-button");

View File

@ -1286,12 +1286,12 @@ gtk_container_destroy (GtkWidget *widget)
*
* Adds @widget to @container. Typically used for simple containers
* such as #GtkWindow, #GtkFrame, or #GtkButton; for more complicated
* layout containers such as #GtkBox or #GtkGrid, this function will
* layout containers such #GtkGrid, this function will
* pick default packing parameters that may not be correct. So
* consider functions such as gtk_box_pack_start() and
* gtk_grid_attach() as an alternative to gtk_container_add() in
* those cases. A widget may be added to only one container at a time;
* you cant place the same widget inside two different containers.
* consider functions such as gtk_grid_attach() as an alternative
* to gtk_container_add() in those cases. A widget may be added to
* only one container at a time; you cant place the same widget
* inside two different containers.
*
* Note that some containers, such as #GtkScrolledWindow or #GtkListBox,
* may add intermediate children between the added widget and the

View File

@ -553,7 +553,7 @@ new_unit_widget (GtkCustomPaperUnixDialog *dialog,
else
gtk_spin_button_set_digits (GTK_SPIN_BUTTON (button), 1);
gtk_box_pack_start (GTK_BOX (hbox), button);
gtk_container_add (GTK_CONTAINER (hbox), button);
gtk_widget_show (button);
data->spin_button = button;
@ -567,7 +567,7 @@ new_unit_widget (GtkCustomPaperUnixDialog *dialog,
label = gtk_label_new (_("mm"));
gtk_widget_set_valign (label, GTK_ALIGN_BASELINE);
gtk_box_pack_start (GTK_BOX (hbox), label);
gtk_container_add (GTK_CONTAINER (hbox), label);
gtk_widget_show (label);
gtk_label_set_mnemonic_widget (GTK_LABEL (mnemonic_label), button);
@ -977,13 +977,13 @@ wrap_in_frame (const gchar *label,
g_free (bold_text);
frame = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (frame), label_widget);
gtk_container_add (GTK_CONTAINER (frame), label_widget);
gtk_widget_set_margin_start (child, 12);
gtk_widget_set_halign (child, GTK_ALIGN_FILL);
gtk_widget_set_valign (child, GTK_ALIGN_FILL);
gtk_box_pack_start (GTK_BOX (frame), child);
gtk_container_add (GTK_CONTAINER (frame), child);
gtk_widget_show (frame);
@ -1034,11 +1034,11 @@ populate_dialog (GtkCustomPaperUnixDialog *dialog)
gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 18);
gtk_box_pack_start (GTK_BOX (content_area), hbox);
gtk_container_add (GTK_CONTAINER (content_area), hbox);
gtk_widget_show (hbox);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_box_pack_start (GTK_BOX (hbox), vbox);
gtk_container_add (GTK_CONTAINER (hbox), vbox);
gtk_widget_show (vbox);
scrolled = gtk_scrolled_window_new (NULL, NULL);
@ -1046,7 +1046,7 @@ populate_dialog (GtkCustomPaperUnixDialog *dialog)
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled),
GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (vbox), scrolled);
gtk_container_add (GTK_CONTAINER (vbox), scrolled);
gtk_widget_show (scrolled);
treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (priv->custom_paper_list));
@ -1076,7 +1076,7 @@ populate_dialog (GtkCustomPaperUnixDialog *dialog)
context = gtk_widget_get_style_context (toolbar);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_INLINE_TOOLBAR);
gtk_box_pack_start (GTK_BOX (vbox), toolbar);
gtk_container_add (GTK_CONTAINER (vbox), toolbar);
gtk_widget_show (toolbar);
icon = g_themed_icon_new_with_default_fallbacks ("list-add-symbolic");
@ -1095,7 +1095,7 @@ populate_dialog (GtkCustomPaperUnixDialog *dialog)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 18);
priv->values_box = vbox;
gtk_box_pack_start (GTK_BOX (hbox), vbox);
gtk_container_add (GTK_CONTAINER (hbox), vbox);
gtk_widget_show (vbox);
grid = gtk_grid_new ();
@ -1127,7 +1127,7 @@ populate_dialog (GtkCustomPaperUnixDialog *dialog)
frame = wrap_in_frame (_("Paper Size"), grid);
gtk_widget_show (grid);
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
gtk_widget_show (frame);
grid = gtk_grid_new ();
@ -1200,7 +1200,7 @@ populate_dialog (GtkCustomPaperUnixDialog *dialog)
NULL, NULL);
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
gtk_box_pack_start (GTK_BOX (hbox), combo);
gtk_container_add (GTK_CONTAINER (hbox), combo);
gtk_widget_show (combo);
g_signal_connect_swapped (combo, "changed",
@ -1208,7 +1208,7 @@ populate_dialog (GtkCustomPaperUnixDialog *dialog)
frame = wrap_in_frame (_("Paper Margins"), grid);
gtk_widget_show (grid);
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
gtk_widget_show (frame);
update_custom_widgets_from_list (dialog);

View File

@ -514,13 +514,13 @@ add_emoji (GtkWidget *list,
gtk_widget_set_focus_on_click (child, FALSE);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_add (GTK_CONTAINER (child), box);
gtk_box_pack_start (GTK_BOX (box), label);
gtk_container_add (GTK_CONTAINER (box), label);
g_object_set_data (G_OBJECT (child), "base", label);
stack = gtk_stack_new ();
gtk_stack_set_homogeneous (GTK_STACK (stack), TRUE);
gtk_stack_set_transition_type (GTK_STACK (stack), GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT);
gtk_box_pack_start (GTK_BOX (box), stack);
gtk_container_add (GTK_CONTAINER (box), stack);
g_object_set_data (G_OBJECT (child), "stack", stack);
g_variant_get_child (emoji_data, 2, "&s", &shortname);

View File

@ -1219,7 +1219,7 @@ gtk_entry_completion_insert_action (GtkEntryCompletion *completion,
path, NULL, FALSE);
gtk_tree_path_free (path);
gtk_box_pack_start (GTK_BOX (completion->priv->vbox),
gtk_container_add (GTK_CONTAINER (completion->priv->vbox),
completion->priv->action_view);
gtk_widget_show (completion->priv->action_view);
}

View File

@ -916,7 +916,7 @@ update_preview_widget_visibility (GtkFileChooserWidget *impl)
if (!priv->preview_label)
{
priv->preview_label = gtk_label_new (priv->preview_display_name);
gtk_box_pack_start (GTK_BOX (priv->preview_box), priv->preview_label);
gtk_container_add (GTK_CONTAINER (priv->preview_box), priv->preview_label);
gtk_box_reorder_child (GTK_BOX (priv->preview_box), priv->preview_label, 0);
gtk_label_set_ellipsize (GTK_LABEL (priv->preview_label), PANGO_ELLIPSIZE_MIDDLE);
gtk_widget_show (priv->preview_label);
@ -957,7 +957,7 @@ set_preview_widget (GtkFileChooserWidget *impl,
if (priv->preview_widget)
{
gtk_widget_show (priv->preview_widget);
gtk_box_pack_start (GTK_BOX (priv->preview_box), priv->preview_widget);
gtk_container_add (GTK_CONTAINER (priv->preview_box), priv->preview_widget);
gtk_box_reorder_child (GTK_BOX (priv->preview_box),
priv->preview_widget,
(priv->use_preview_label && priv->preview_label) ? 1 : 0);
@ -2587,7 +2587,7 @@ save_widgets_create (GtkFileChooserWidget *impl)
gtk_style_context_add_class (gtk_widget_get_style_context (vbox), "search-bar");
priv->save_widgets_table = gtk_grid_new ();
gtk_box_pack_start (GTK_BOX (vbox), priv->save_widgets_table);
gtk_container_add (GTK_CONTAINER (vbox), priv->save_widgets_table);
gtk_grid_set_row_spacing (GTK_GRID (priv->save_widgets_table), 12);
gtk_grid_set_column_spacing (GTK_GRID (priv->save_widgets_table), 12);
@ -2607,7 +2607,7 @@ save_widgets_create (GtkFileChooserWidget *impl)
gtk_label_set_mnemonic_widget (GTK_LABEL (widget), priv->location_entry);
priv->save_widgets = vbox;
gtk_box_pack_start (GTK_BOX (priv->box), priv->save_widgets);
gtk_container_add (GTK_CONTAINER (priv->box), priv->save_widgets);
gtk_box_reorder_child (GTK_BOX (priv->box), priv->save_widgets, 0);
gtk_widget_show (priv->save_widgets);
}
@ -2675,7 +2675,7 @@ location_switch_to_filename_entry (GtkFileChooserWidget *impl)
if (!priv->location_entry)
{
location_entry_create (impl);
gtk_box_pack_start (GTK_BOX (priv->location_entry_box), priv->location_entry);
gtk_container_add (GTK_CONTAINER (priv->location_entry_box), priv->location_entry);
}
_gtk_file_chooser_entry_set_base_folder (GTK_FILE_CHOOSER_ENTRY (priv->location_entry), priv->current_folder);

View File

@ -152,7 +152,7 @@ init_sizing_box (GtkHeaderBar *bar)
w = gtk_label_new (NULL);
context = gtk_widget_get_style_context (w);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_TITLE);
gtk_box_pack_start (GTK_BOX (priv->label_sizing_box), w);
gtk_container_add (GTK_CONTAINER (priv->label_sizing_box), w);
gtk_label_set_line_wrap (GTK_LABEL (w), FALSE);
gtk_label_set_single_line_mode (GTK_LABEL (w), TRUE);
gtk_label_set_ellipsize (GTK_LABEL (w), PANGO_ELLIPSIZE_END);
@ -161,7 +161,7 @@ init_sizing_box (GtkHeaderBar *bar)
w = gtk_label_new (NULL);
context = gtk_widget_get_style_context (w);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_SUBTITLE);
gtk_box_pack_start (GTK_BOX (priv->label_sizing_box), w);
gtk_container_add (GTK_CONTAINER (priv->label_sizing_box), w);
gtk_label_set_line_wrap (GTK_LABEL (w), FALSE);
gtk_label_set_single_line_mode (GTK_LABEL (w), TRUE);
gtk_label_set_ellipsize (GTK_LABEL (w), PANGO_ELLIPSIZE_END);
@ -189,7 +189,7 @@ create_title_box (const char *title,
gtk_label_set_line_wrap (GTK_LABEL (title_label), FALSE);
gtk_label_set_single_line_mode (GTK_LABEL (title_label), TRUE);
gtk_label_set_ellipsize (GTK_LABEL (title_label), PANGO_ELLIPSIZE_END);
gtk_box_pack_start (GTK_BOX (label_box), title_label);
gtk_container_add (GTK_CONTAINER (label_box), title_label);
gtk_label_set_width_chars (GTK_LABEL (title_label), MIN_TITLE_CHARS);
subtitle_label = gtk_label_new (subtitle);
@ -198,7 +198,7 @@ create_title_box (const char *title,
gtk_label_set_line_wrap (GTK_LABEL (subtitle_label), FALSE);
gtk_label_set_single_line_mode (GTK_LABEL (subtitle_label), TRUE);
gtk_label_set_ellipsize (GTK_LABEL (subtitle_label), PANGO_ELLIPSIZE_END);
gtk_box_pack_start (GTK_BOX (label_box), subtitle_label);
gtk_container_add (GTK_CONTAINER (label_box), subtitle_label);
gtk_widget_set_visible (subtitle_label, subtitle && subtitle[0]);
if (ret_title_label)
@ -453,7 +453,7 @@ _gtk_header_bar_update_window_buttons (GtkHeaderBar *bar)
if (button)
{
gtk_box_pack_start (GTK_BOX (box), button);
gtk_container_add (GTK_CONTAINER (box), button);
n_children ++;
}
}
@ -468,7 +468,7 @@ _gtk_header_bar_update_window_buttons (GtkHeaderBar *bar)
continue;
}
gtk_box_pack_start (GTK_BOX (box), separator);
gtk_container_add (GTK_CONTAINER (box), separator);
if (i == 1)
gtk_box_reorder_child (GTK_BOX (box), separator, 0);

View File

@ -490,6 +490,7 @@ gtk_info_bar_add_action_widget (GtkInfoBar *info_bar,
ad = get_response_data (child, TRUE);
G_DEBUG_HERE();
ad->response_id = response_id;
if (GTK_IS_BUTTON (child))
@ -508,7 +509,7 @@ gtk_info_bar_add_action_widget (GtkInfoBar *info_bar,
else
g_warning ("Only 'activatable' widgets can be packed into the action area of a GtkInfoBar");
gtk_box_pack_end (GTK_BOX (priv->action_area), child);
gtk_container_add (GTK_CONTAINER (priv->action_area), child);
if (response_id == GTK_RESPONSE_HELP)
gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (priv->action_area),
child, TRUE);

View File

@ -134,7 +134,10 @@ gtk_menu_section_box_sync_separators (GtkMenuSectionBox *box,
return;
if (should_have_separator)
gtk_box_pack_start (GTK_BOX (box), box->separator);
{
gtk_container_add (GTK_CONTAINER (box), box->separator);
gtk_box_reorder_child (GTK_BOX (box), box->separator, 0);
}
else
gtk_container_remove (GTK_CONTAINER (box), box->separator);
}
@ -346,7 +349,7 @@ gtk_menu_section_box_init (GtkMenuSectionBox *box)
item_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
box->item_box = GTK_BOX (item_box);
gtk_box_pack_end (GTK_BOX (box), item_box);
gtk_container_add (GTK_CONTAINER (box), item_box);
gtk_widget_set_halign (GTK_WIDGET (item_box), GTK_ALIGN_FILL);
gtk_widget_set_halign (GTK_WIDGET (box), GTK_ALIGN_FILL);
@ -454,7 +457,8 @@ gtk_menu_section_box_new_submenu (GtkMenuTrackerItem *item,
g_object_set_data (G_OBJECT (button), "focus", focus);
g_object_set_data (G_OBJECT (focus), "focus", button);
gtk_box_pack_start (GTK_BOX (box), button);
gtk_container_add (GTK_CONTAINER (box), button);
gtk_box_reorder_child (GTK_BOX (box), button, 0);
g_signal_connect (focus, "clicked", G_CALLBACK (open_submenu), item);
g_signal_connect (button, "clicked", G_CALLBACK (close_submenu), item);
@ -515,17 +519,17 @@ gtk_menu_section_box_new_section (GtkMenuTrackerItem *item,
separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
gtk_widget_set_valign (separator, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (box->separator), separator);
gtk_container_add (GTK_CONTAINER (box->separator), separator);
title = gtk_label_new (label);
g_object_bind_property (item, "label", title, "label", G_BINDING_SYNC_CREATE);
gtk_style_context_add_class (gtk_widget_get_style_context (title), GTK_STYLE_CLASS_SEPARATOR);
gtk_widget_set_halign (title, GTK_ALIGN_START);
gtk_box_pack_start (GTK_BOX (box->separator), title);
gtk_container_add (GTK_CONTAINER (box->separator), title);
separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
gtk_widget_set_valign (separator, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (box->separator), separator);
gtk_container_add (GTK_CONTAINER (box->separator), separator);
}
else
{

View File

@ -140,7 +140,7 @@ gtk_menu_tool_button_construct_contents (GtkMenuToolButton *button)
g_object_ref (priv->arrow_button);
gtk_container_remove (GTK_CONTAINER (parent),
priv->arrow_button);
gtk_box_pack_end (GTK_BOX (box), priv->arrow_button);
gtk_container_add (GTK_CONTAINER (box), priv->arrow_button);
g_object_unref (priv->arrow_button);
}
@ -284,7 +284,7 @@ gtk_menu_tool_button_init (GtkMenuToolButton *button)
g_object_unref (real_button);
arrow_button = gtk_menu_button_new ();
gtk_box_pack_end (GTK_BOX (box), arrow_button);
gtk_container_add (GTK_CONTAINER (box), arrow_button);
/* the arrow button is insentive until we set a menu */
gtk_widget_set_sensitive (arrow_button, FALSE);

View File

@ -548,17 +548,17 @@ gtk_mount_operation_ask_password_do_gtk (GtkMountOperation *operation,
/* Build contents */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_box_pack_start (GTK_BOX (content_area), hbox);
gtk_container_add (GTK_CONTAINER (content_area), hbox);
icon = gtk_image_new_from_icon_name ("dialog-password");
gtk_image_set_icon_size (GTK_IMAGE (icon), GTK_ICON_SIZE_LARGE);
gtk_widget_set_halign (icon, GTK_ALIGN_CENTER);
gtk_widget_set_valign (icon, GTK_ALIGN_START);
gtk_box_pack_start (GTK_BOX (hbox), icon);
gtk_container_add (GTK_CONTAINER (hbox), icon);
main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 18);
gtk_box_pack_start (GTK_BOX (hbox), main_vbox);
gtk_container_add (GTK_CONTAINER (hbox), main_vbox);
secondary = strstr (message, "\n");
if (secondary != NULL)
@ -574,7 +574,7 @@ gtk_mount_operation_ask_password_do_gtk (GtkMountOperation *operation,
gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_box_pack_start (GTK_BOX (main_vbox), GTK_WIDGET (label));
gtk_container_add (GTK_CONTAINER (main_vbox), GTK_WIDGET (label));
g_free (primary);
attrs = pango_attr_list_new ();
pango_attr_list_insert (attrs, pango_attr_weight_new (PANGO_WEIGHT_BOLD));
@ -587,7 +587,7 @@ gtk_mount_operation_ask_password_do_gtk (GtkMountOperation *operation,
gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_box_pack_start (GTK_BOX (main_vbox), GTK_WIDGET (label));
gtk_container_add (GTK_CONTAINER (main_vbox), GTK_WIDGET (label));
}
grid = gtk_grid_new ();
@ -595,7 +595,7 @@ gtk_mount_operation_ask_password_do_gtk (GtkMountOperation *operation,
gtk_grid_set_row_spacing (GTK_GRID (grid), 12);
gtk_grid_set_column_spacing (GTK_GRID (grid), 12);
gtk_widget_set_margin_bottom (grid, 12);
gtk_box_pack_start (GTK_BOX (main_vbox), grid);
gtk_container_add (GTK_CONTAINER (main_vbox), grid);
can_anonymous = priv->ask_flags & G_ASK_PASSWORD_ANONYMOUS_SUPPORTED;
@ -618,7 +618,7 @@ gtk_mount_operation_ask_password_do_gtk (GtkMountOperation *operation,
gtk_grid_attach (GTK_GRID (grid), anon_box, 1, rows++, 1, 1);
choice = gtk_radio_button_new_with_mnemonic (NULL, _("_Anonymous"));
gtk_box_pack_start (GTK_BOX (anon_box),
gtk_container_add (GTK_CONTAINER (anon_box),
choice);
g_signal_connect (choice, "toggled",
G_CALLBACK (pw_dialog_anonymous_toggled), operation);
@ -626,7 +626,7 @@ gtk_mount_operation_ask_password_do_gtk (GtkMountOperation *operation,
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (choice));
choice = gtk_radio_button_new_with_mnemonic (group, _("Registered U_ser"));
gtk_box_pack_start (GTK_BOX (anon_box),
gtk_container_add (GTK_CONTAINER (anon_box),
choice);
g_signal_connect (choice, "toggled",
G_CALLBACK (pw_dialog_anonymous_toggled), operation);
@ -675,7 +675,7 @@ gtk_mount_operation_ask_password_do_gtk (GtkMountOperation *operation,
GINT_TO_POINTER (G_PASSWORD_SAVE_NEVER));
g_signal_connect (choice, "toggled",
G_CALLBACK (remember_button_toggled), operation);
gtk_box_pack_start (GTK_BOX (remember_box), choice);
gtk_container_add (GTK_CONTAINER (remember_box), choice);
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (choice));
choice = gtk_radio_button_new_with_mnemonic (group, _("Remember password until you _logout"));
@ -685,7 +685,7 @@ gtk_mount_operation_ask_password_do_gtk (GtkMountOperation *operation,
GINT_TO_POINTER (G_PASSWORD_SAVE_FOR_SESSION));
g_signal_connect (choice, "toggled",
G_CALLBACK (remember_button_toggled), operation);
gtk_box_pack_start (GTK_BOX (remember_box), choice);
gtk_container_add (GTK_CONTAINER (remember_box), choice);
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (choice));
choice = gtk_radio_button_new_with_mnemonic (group, _("Remember _forever"));
@ -695,7 +695,7 @@ gtk_mount_operation_ask_password_do_gtk (GtkMountOperation *operation,
GINT_TO_POINTER (G_PASSWORD_SAVE_PERMANENTLY));
g_signal_connect (choice, "toggled",
G_CALLBACK (remember_button_toggled), operation);
gtk_box_pack_start (GTK_BOX (remember_box), choice);
gtk_container_add (GTK_CONTAINER (remember_box), choice);
}
g_signal_connect (G_OBJECT (dialog), "response",
@ -1403,7 +1403,7 @@ create_show_processes_dialog (GtkMountOperation *op,
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
gtk_box_pack_start (GTK_BOX (content_area), vbox);
gtk_container_add (GTK_CONTAINER (content_area), vbox);
if (secondary != NULL)
s = g_strdup_printf ("<big><b>%s</b></big>\n\n%s", primary, secondary);
@ -1414,7 +1414,7 @@ create_show_processes_dialog (GtkMountOperation *op,
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label), s);
g_free (s);
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
/* First count the items in the list then
* add the buttons in reverse order
@ -1464,7 +1464,7 @@ create_show_processes_dialog (GtkMountOperation *op,
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_IN);
gtk_container_add (GTK_CONTAINER (scrolled_window), tree_view);
gtk_box_pack_start (GTK_BOX (vbox), scrolled_window);
gtk_container_add (GTK_CONTAINER (vbox), scrolled_window);
g_signal_connect (tree_view, "popup-menu",
G_CALLBACK (on_popup_menu_for_process_tree_view),

View File

@ -1362,8 +1362,8 @@ make_directory_button (GtkPathBar *path_bar,
button_data->image = gtk_image_new ();
button_data->label = gtk_label_new (NULL);
child = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (child), button_data->image);
gtk_box_pack_start (GTK_BOX (child), button_data->label);
gtk_container_add (GTK_CONTAINER (child), button_data->image);
gtk_container_add (GTK_CONTAINER (child), button_data->label);
break;
case NORMAL_BUTTON:
default:

View File

@ -684,12 +684,12 @@ request_password (GtkPrintBackend *backend,
/* Packing */
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
gtk_box_pack_start (GTK_BOX (content_area), main_box);
gtk_container_add (GTK_CONTAINER (content_area), main_box);
gtk_box_pack_start (GTK_BOX (main_box), icon);
gtk_box_pack_start (GTK_BOX (main_box), vbox);
gtk_container_add (GTK_CONTAINER (main_box), icon);
gtk_container_add (GTK_CONTAINER (main_box), vbox);
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
/* Right - 2. */
for (i = 0; i < length; i++)
@ -715,10 +715,10 @@ request_password (GtkPrintBackend *backend,
gtk_entry_set_visibility (GTK_ENTRY (entry), ai_visible[i]);
gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
gtk_box_pack_start (GTK_BOX (vbox), box);
gtk_container_add (GTK_CONTAINER (vbox), box);
gtk_box_pack_start (GTK_BOX (box), label);
gtk_box_pack_start (GTK_BOX (box), entry);
gtk_container_add (GTK_CONTAINER (box), label);
gtk_container_add (GTK_CONTAINER (box), entry);
g_signal_connect (entry, "changed",
G_CALLBACK (store_entry), &(priv->auth_info[i]));
@ -731,7 +731,7 @@ request_password (GtkPrintBackend *backend,
gtk_widget_set_margin_top (chkbtn, 6);
gtk_widget_set_margin_bottom (chkbtn, 6);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (chkbtn), FALSE);
gtk_box_pack_start (GTK_BOX (vbox), chkbtn);
gtk_container_add (GTK_CONTAINER (vbox), chkbtn);
g_signal_connect (chkbtn, "toggled",
G_CALLBACK (store_auth_info_toggled),
&(priv->store_auth_info));

View File

@ -745,7 +745,7 @@ alternative_append (GtkWidget *box,
button = gtk_radio_button_new_with_label (group, label);
gtk_widget_show (button);
gtk_widget_set_valign (button, GTK_ALIGN_BASELINE);
gtk_box_pack_start (GTK_BOX (box), button);
gtk_container_add (GTK_CONTAINER (box), button);
g_object_set_data (G_OBJECT (button), "value", (gpointer)value);
g_signal_connect (button, "toggled",
@ -776,7 +776,7 @@ construct_widgets (GtkPrinterOptionWidget *widget)
gtk_combo_box_set_active (GTK_COMBO_BOX (priv->combo), 0);
gtk_widget_set_sensitive (GTK_WIDGET (widget), FALSE);
gtk_widget_show (priv->combo);
gtk_box_pack_start (GTK_BOX (widget), priv->combo);
gtk_container_add (GTK_CONTAINER (widget), priv->combo);
}
else switch (source->type)
{
@ -784,7 +784,7 @@ construct_widgets (GtkPrinterOptionWidget *widget)
priv->check = gtk_check_button_new_with_mnemonic (source->display_text);
g_signal_connect (priv->check, "toggled", G_CALLBACK (check_toggled_cb), widget);
gtk_widget_show (priv->check);
gtk_box_pack_start (GTK_BOX (widget), priv->check);
gtk_container_add (GTK_CONTAINER (widget), priv->check);
break;
case GTK_PRINTER_OPTION_TYPE_PICKONE:
case GTK_PRINTER_OPTION_TYPE_PICKONE_PASSWORD:
@ -816,7 +816,7 @@ construct_widgets (GtkPrinterOptionWidget *widget)
source->choices_display[i],
source->choices[i]);
gtk_widget_show (priv->combo);
gtk_box_pack_start (GTK_BOX (widget), priv->combo);
gtk_container_add (GTK_CONTAINER (widget), priv->combo);
g_signal_connect (priv->combo, "changed", G_CALLBACK (combo_changed_cb), widget);
text = g_strdup_printf ("%s:", source->display_text);
@ -830,7 +830,7 @@ construct_widgets (GtkPrinterOptionWidget *widget)
priv->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_widget_set_valign (priv->box, GTK_ALIGN_BASELINE);
gtk_widget_show (priv->box);
gtk_box_pack_start (GTK_BOX (widget), priv->box);
gtk_container_add (GTK_CONTAINER (widget), priv->box);
for (i = 0; i < source->num_choices; i++)
{
group = alternative_append (priv->box,
@ -858,7 +858,7 @@ construct_widgets (GtkPrinterOptionWidget *widget)
gtk_entry_set_activates_default (GTK_ENTRY (priv->entry),
gtk_printer_option_get_activates_default (source));
gtk_widget_show (priv->entry);
gtk_box_pack_start (GTK_BOX (widget), priv->entry);
gtk_container_add (GTK_CONTAINER (widget), priv->entry);
g_signal_connect (priv->entry, "changed", G_CALLBACK (entry_changed_cb), widget);
text = g_strdup_printf ("%s:", source->display_text);
@ -871,7 +871,7 @@ construct_widgets (GtkPrinterOptionWidget *widget)
case GTK_PRINTER_OPTION_TYPE_FILESAVE:
priv->button = gtk_button_new ();
gtk_widget_show (priv->button);
gtk_box_pack_start (GTK_BOX (widget), priv->button);
gtk_container_add (GTK_CONTAINER (widget), priv->button);
g_signal_connect (priv->button, "clicked", G_CALLBACK (filesave_choose_cb), widget);
text = g_strdup_printf ("%s:", source->display_text);
@ -884,7 +884,7 @@ construct_widgets (GtkPrinterOptionWidget *widget)
case GTK_PRINTER_OPTION_TYPE_INFO:
priv->info_label = gtk_label_new (NULL);
gtk_label_set_selectable (GTK_LABEL (priv->info_label), TRUE);
gtk_box_pack_start (GTK_BOX (widget), priv->info_label);
gtk_container_add (GTK_CONTAINER (widget), priv->info_label);
text = g_strdup_printf ("%s:", source->display_text);
priv->label = gtk_label_new_with_mnemonic (text);
@ -897,7 +897,7 @@ construct_widgets (GtkPrinterOptionWidget *widget)
}
priv->image = gtk_image_new_from_icon_name ("dialog-warning");
gtk_box_pack_start (GTK_BOX (widget), priv->image);
gtk_container_add (GTK_CONTAINER (widget), priv->image);
}
/*

View File

@ -1295,13 +1295,13 @@ wrap_in_frame (const gchar *label,
g_free (bold_text);
frame = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (frame), label_widget);
gtk_container_add (GTK_CONTAINER (frame), label_widget);
gtk_widget_set_margin_start (child, 12);
gtk_widget_set_halign (child, GTK_ALIGN_FILL);
gtk_widget_set_valign (child, GTK_ALIGN_FILL);
gtk_box_pack_start (GTK_BOX (frame), child);
gtk_container_add (GTK_CONTAINER (frame), child);
gtk_widget_show (frame);
@ -1346,14 +1346,14 @@ add_option_to_extension_point (GtkPrinterOption *option,
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_widget_set_valign (hbox, GTK_ALIGN_BASELINE);
gtk_box_pack_start (GTK_BOX (hbox), label);
gtk_box_pack_start (GTK_BOX (hbox), widget);
gtk_container_add (GTK_CONTAINER (hbox), label);
gtk_container_add (GTK_CONTAINER (hbox), widget);
gtk_widget_show (hbox);
gtk_box_pack_start (GTK_BOX (extension_point), hbox);
gtk_container_add (GTK_CONTAINER (extension_point), hbox);
}
else
gtk_box_pack_start (GTK_BOX (extension_point), widget);
gtk_container_add (GTK_CONTAINER (extension_point), widget);
}
static gint
@ -1631,7 +1631,7 @@ update_dialog_from_settings (GtkPrintUnixDialog *dialog)
gtk_widget_show (table);
gtk_widget_show (frame);
gtk_box_pack_start (GTK_BOX (priv->advanced_vbox),
gtk_container_add (GTK_CONTAINER (priv->advanced_vbox),
frame);
}
}

View File

@ -113,8 +113,8 @@
* "Im the second radio button.");
*
* // Pack them into a box, then show all the widgets
* gtk_box_pack_start (GTK_BOX (box), radio1);
* gtk_box_pack_start (GTK_BOX (box), radio2);
* gtk_container_add (GTK_CONTAINER (box), radio1);
* gtk_container_add (GTK_CONTAINER (box), radio2);
* gtk_container_add (GTK_CONTAINER (window), box);
* gtk_widget_show (window);
* return;

View File

@ -503,9 +503,11 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
else
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL,0);
if (icon)
gtk_box_pack_start (GTK_BOX (box), icon);
gtk_box_pack_end (GTK_BOX (box), label);
gtk_container_add (GTK_CONTAINER (box), icon);
gtk_container_add (GTK_CONTAINER (box), label);
gtk_container_add (GTK_CONTAINER (button->priv->button), box);
gtk_style_context_add_class (gtk_widget_get_style_context (button->priv->button), "image-button");
gtk_style_context_add_class (gtk_widget_get_style_context (button->priv->button), "text-button");
@ -517,24 +519,24 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
if (icon)
{
gtk_box_pack_start (GTK_BOX (box), icon);
gtk_container_add (GTK_CONTAINER (box), icon);
if (!label)
gtk_widget_set_hexpand (icon, TRUE);
}
if (label)
gtk_box_pack_end (GTK_BOX (box), label);
gtk_container_add (GTK_CONTAINER (box), label);
}
else
{
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
if (icon)
{
gtk_box_pack_end (GTK_BOX (box), icon);
gtk_container_add (GTK_CONTAINER (box), icon);
if (!label)
gtk_widget_set_vexpand (icon, TRUE);
}
if (label)
gtk_box_pack_start (GTK_BOX (box), label);
gtk_container_add (GTK_CONTAINER (box), label);
}
gtk_container_add (GTK_CONTAINER (button->priv->button), box);
gtk_style_context_add_class (gtk_widget_get_style_context (button->priv->button), "image-button");

View File

@ -859,13 +859,13 @@ gtk_tree_view_column_create_button (GtkTreeViewColumn *tree_column)
if (priv->xalign <= 0.5)
{
gtk_box_pack_start (GTK_BOX (hbox), priv->frame);
gtk_box_pack_start (GTK_BOX (hbox), priv->arrow);
gtk_container_add (GTK_CONTAINER (hbox), priv->frame);
gtk_container_add (GTK_CONTAINER (hbox), priv->arrow);
}
else
{
gtk_box_pack_start (GTK_BOX (hbox), priv->arrow);
gtk_box_pack_start (GTK_BOX (hbox), priv->frame);
gtk_container_add (GTK_CONTAINER (hbox), priv->arrow);
gtk_container_add (GTK_CONTAINER (hbox), priv->frame);
}
gtk_container_add (GTK_CONTAINER (priv->frame), child);

View File

@ -168,13 +168,13 @@ add_check_row (GtkInspectorGeneral *gen,
gtk_widget_set_valign (label, GTK_ALIGN_BASELINE);
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
gtk_widget_set_hexpand (label, TRUE);
gtk_box_pack_start (GTK_BOX (box), label);
gtk_container_add (GTK_CONTAINER (box), label);
check = gtk_image_new_from_icon_name ("object-select-symbolic");
gtk_widget_set_halign (check, GTK_ALIGN_END);
gtk_widget_set_valign (check, GTK_ALIGN_BASELINE);
gtk_widget_set_opacity (check, value ? 1.0 : 0.0);
gtk_box_pack_start (GTK_BOX (box), check);
gtk_container_add (GTK_CONTAINER (box), check);
row = gtk_list_box_row_new ();
gtk_container_add (GTK_CONTAINER (row), box);
@ -208,14 +208,14 @@ add_label_row (GtkInspectorGeneral *gen,
gtk_widget_set_valign (label, GTK_ALIGN_BASELINE);
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
gtk_widget_set_hexpand (label, TRUE);
gtk_box_pack_start (GTK_BOX (box), label);
gtk_container_add (GTK_CONTAINER (box), label);
label = gtk_label_new (value);
gtk_label_set_selectable (GTK_LABEL (label), TRUE);
gtk_widget_set_halign (label, GTK_ALIGN_END);
gtk_widget_set_valign (label, GTK_ALIGN_BASELINE);
gtk_label_set_xalign (GTK_LABEL (label), 1.0);
gtk_box_pack_start (GTK_BOX (box), label);
gtk_container_add (GTK_CONTAINER (box), label);
row = gtk_list_box_row_new ();
gtk_container_add (GTK_CONTAINER (row), box);

View File

@ -938,7 +938,7 @@ property_editor (GObject *object,
first = b;
g_object_set_data (G_OBJECT (b), "index", GINT_TO_POINTER (j));
gtk_widget_show (b);
gtk_box_pack_start (GTK_BOX (box), b);
gtk_container_add (GTK_CONTAINER (box), b);
connect_controller (G_OBJECT (b), "toggled",
object, spec, G_CALLBACK (enum_modified));
++j;
@ -980,7 +980,7 @@ property_editor (GObject *object,
b = gtk_check_button_new_with_label (fclass->values[j].value_name);
g_object_set_data (G_OBJECT (b), "index", GINT_TO_POINTER (j));
gtk_widget_show (b);
gtk_box_pack_start (GTK_BOX (box), b);
gtk_container_add (GTK_CONTAINER (box), b);
connect_controller (G_OBJECT (b), "toggled",
object, spec, G_CALLBACK (flags_modified));
}
@ -1603,9 +1603,8 @@ add_gtk_settings_info (GtkInspectorPropEditor *editor)
g_signal_connect_swapped (button, "clicked", G_CALLBACK (reset_setting), editor);
gtk_widget_set_halign (button, GTK_ALIGN_END);
gtk_widget_show (button);
gtk_widget_set_sensitive (button, FALSE);
gtk_box_pack_end (GTK_BOX (row), button);
gtk_container_add (GTK_CONTAINER (row), button);
switch (_gtk_settings_get_setting_source (GTK_SETTINGS (object), name))
{

View File

@ -1065,7 +1065,7 @@ gtk_inspector_recorder_recordings_list_create_widget (gpointer item,
widget = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_box_pack_start (GTK_BOX (widget), hbox);
gtk_container_add (GTK_CONTAINER (widget), hbox);
for (i = 0; i < g_list_model_get_n_items (priv->recordings); i++)
{
@ -1106,17 +1106,17 @@ gtk_inspector_recorder_recordings_list_create_widget (gpointer item,
label = gtk_label_new (str);
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
g_free (str);
gtk_box_pack_start (GTK_BOX (hbox), label);
gtk_container_add (GTK_CONTAINER (hbox), label);
button = gtk_toggle_button_new ();
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
gtk_button_set_icon_name (GTK_BUTTON (button), "view-more-symbolic");
gtk_box_pack_end (GTK_BOX (hbox), button);
gtk_container_add (GTK_CONTAINER (hbox), button);
label = gtk_label_new (gtk_inspector_render_recording_get_profiler_info (GTK_INSPECTOR_RENDER_RECORDING (recording)));
gtk_widget_hide (label);
gtk_box_pack_end (GTK_BOX (widget), label);
gtk_container_add (GTK_CONTAINER (widget), label);
g_object_bind_property (button, "active", label, "visible", 0);
}
else

View File

@ -236,7 +236,7 @@ add_size_group (GtkInspectorSizeGroups *sl,
g_object_set (label, "margin", 10, NULL);
gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_widget_set_valign (label, GTK_ALIGN_BASELINE);
gtk_box_pack_start (GTK_BOX (box2), label);
gtk_container_add (GTK_CONTAINER (box2), label);
combo = gtk_combo_box_text_new ();
g_object_set (combo, "margin", 10, NULL);
@ -249,7 +249,7 @@ add_size_group (GtkInspectorSizeGroups *sl,
g_object_bind_property (group, "mode",
combo, "active",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
gtk_box_pack_start (GTK_BOX (box2), combo);
gtk_container_add (GTK_CONTAINER (box2), combo);
listbox = gtk_list_box_new ();
gtk_container_add (GTK_CONTAINER (box), listbox);

View File

@ -68,17 +68,17 @@ add_string (GtkInspectorStrvEditor *editor,
entry = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (entry), str);
gtk_widget_show (entry);
gtk_box_pack_start (GTK_BOX (box), entry);
gtk_container_add (GTK_CONTAINER (box), entry);
g_object_set_data (G_OBJECT (box), "entry", entry);
g_signal_connect_swapped (entry, "notify::text", G_CALLBACK (emit_changed), editor);
button = gtk_button_new_from_icon_name ("user-trash-symbolic");
gtk_style_context_add_class (gtk_widget_get_style_context (button), "image-button");
gtk_widget_show (button);
gtk_box_pack_start (GTK_BOX (box), button);
gtk_container_add (GTK_CONTAINER (box), button);
g_signal_connect (button, "clicked", G_CALLBACK (remove_string), editor);
gtk_box_pack_start (GTK_BOX (editor->box), box);
gtk_container_add (GTK_CONTAINER (editor->box), box);
gtk_widget_grab_focus (entry);
@ -107,8 +107,8 @@ gtk_inspector_strv_editor_init (GtkInspectorStrvEditor *editor)
gtk_widget_show (editor->button);
g_signal_connect (editor->button, "clicked", G_CALLBACK (add_cb), editor);
gtk_box_pack_start (GTK_BOX (editor), editor->box);
gtk_box_pack_start (GTK_BOX (editor), editor->button);
gtk_container_add (GTK_CONTAINER (editor), editor->box);
gtk_container_add (GTK_CONTAINER (editor), editor->button);
}
static void

View File

@ -174,37 +174,40 @@ main (int argc, char *argv[])
gtk_widget_show (hbox);
fps_label = gtk_label_new ("");
gtk_widget_set_hexpand (fps_label, TRUE);
gtk_widget_set_halign (fps_label, GTK_ALIGN_START);
gtk_container_add (GTK_CONTAINER (hbox), fps_label);
gtk_widget_show (fps_label);
gtk_gears_set_fps_label (GTK_GEARS (gears), GTK_LABEL (fps_label));
spinner = gtk_spinner_new ();
gtk_box_pack_end (GTK_BOX (hbox), spinner);
gtk_widget_show (spinner);
gtk_spinner_start (GTK_SPINNER (spinner));
check = gtk_check_button_new_with_label ("Animate spinner");
gtk_box_pack_end (GTK_BOX (hbox), check);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE);
gtk_widget_show (check);
g_signal_connect (check, "toggled",
G_CALLBACK (toggle_spin), spinner);
check = gtk_check_button_new_with_label ("Overlay");
gtk_box_pack_end (GTK_BOX (hbox), check);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), FALSE);
gtk_widget_show (check);
g_signal_connect (check, "toggled",
G_CALLBACK (toggle_overlay), revealer);
button = gtk_menu_button_new ();
gtk_menu_button_set_direction (GTK_MENU_BUTTON (button), GTK_ARROW_UP);
popover = gtk_popover_new (NULL);
label = gtk_label_new ("Popovers work too!");
gtk_widget_show (label);
gtk_container_add (GTK_CONTAINER (popover), label);
gtk_menu_button_set_popover (GTK_MENU_BUTTON (button), popover);
gtk_widget_show (button);
gtk_box_pack_end (GTK_BOX (hbox), button);
gtk_container_add (GTK_CONTAINER (hbox), button);
check = gtk_check_button_new_with_label ("Overlay");
gtk_container_add (GTK_CONTAINER (hbox), check);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), FALSE);
g_signal_connect (check, "toggled",
G_CALLBACK (toggle_overlay), revealer);
check = gtk_check_button_new_with_label ("Animate spinner");
gtk_container_add (GTK_CONTAINER (hbox), check);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE);
spinner = gtk_spinner_new ();
gtk_container_add (GTK_CONTAINER (hbox), spinner);
gtk_spinner_start (GTK_SPINNER (spinner));
g_signal_connect (check, "toggled",
G_CALLBACK (toggle_spin), spinner);
scrolled = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),

View File

@ -52,18 +52,18 @@ main (int argc, char **argv)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (window), vbox);
adjustment = gtk_adjustment_new (20, 0, 200, 1, 10, 0);
scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, adjustment);
gtk_box_pack_end (GTK_BOX (vbox), scale);
label = gtk_label_new ("Event processing time (ms):");
gtk_widget_set_halign (label, GTK_ALIGN_CENTER);
gtk_box_pack_end (GTK_BOX (vbox), label);
da = gtk_drawing_area_new ();
gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (da), on_draw, NULL, NULL);
gtk_widget_set_vexpand (da, TRUE);
gtk_box_pack_end (GTK_BOX (vbox), da);
gtk_container_add (GTK_CONTAINER (vbox), da);
label = gtk_label_new ("Event processing time (ms):");
gtk_widget_set_halign (label, GTK_ALIGN_CENTER);
gtk_container_add (GTK_CONTAINER (vbox), label);
adjustment = gtk_adjustment_new (20, 0, 200, 1, 10, 0);
scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, adjustment);
gtk_container_add (GTK_CONTAINER (vbox), scale);
controller = gtk_event_controller_motion_new ();
g_signal_connect (controller, "motion",

View File

@ -65,7 +65,7 @@ main (int argc, char *argv[])
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (box), sw);
gtk_container_add (GTK_CONTAINER (box), sw);
content = get_content ();

View File

@ -321,15 +321,15 @@ create_custom_widget (GtkPrintOperation *operation,
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
gtk_widget_show (hbox);
label = gtk_label_new ("Font:");
gtk_box_pack_start (GTK_BOX (hbox), label);
gtk_container_add (GTK_CONTAINER (hbox), label);
gtk_widget_show (label);
font = gtk_font_button_new_with_font (data->font);
gtk_box_pack_start (GTK_BOX (hbox), font);
gtk_container_add (GTK_CONTAINER (hbox), font);
gtk_widget_show (font);
data->font_button = font;

View File

@ -32,7 +32,7 @@ main (int argc, char *argv[])
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_NEVER,
GTK_POLICY_EXTERNAL);
gtk_box_pack_start (GTK_BOX (box), sw);
gtk_container_add (GTK_CONTAINER (box), sw);
tv = gtk_text_view_new ();
fill_text_view (tv, "Left");
gtk_container_add (GTK_CONTAINER (sw), tv);
@ -43,7 +43,7 @@ main (int argc, char *argv[])
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_NEVER,
GTK_POLICY_EXTERNAL);
gtk_box_pack_start (GTK_BOX (box), sw);
gtk_container_add (GTK_CONTAINER (box), sw);
tv = gtk_text_view_new ();
fill_text_view (tv, "Middle");
gtk_container_add (GTK_CONTAINER (sw), tv);
@ -52,7 +52,7 @@ main (int argc, char *argv[])
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_NEVER,
GTK_POLICY_EXTERNAL);
gtk_box_pack_start (GTK_BOX (box), sw);
gtk_container_add (GTK_CONTAINER (box), sw);
tv = gtk_text_view_new ();
fill_text_view (tv, "Right");
gtk_container_add (GTK_CONTAINER (sw), tv);

View File

@ -75,7 +75,7 @@ key_test (void)
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
gtk_widget_show (box);
gtk_container_add (GTK_CONTAINER (window), box);
gtk_box_pack_start (GTK_BOX (box), sw);
gtk_container_add (GTK_CONTAINER (box), sw);
store = gtk_list_store_new (3, G_TYPE_INT, G_TYPE_UINT, G_TYPE_UINT);
tv = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));

View File

@ -116,8 +116,9 @@ activate (GApplication *gapp)
"margin", 20,
"row-spacing", 12,
"column-spacing", 12,
"vexpand", TRUE,
NULL);
gtk_box_pack_start (GTK_BOX (box), grid);
gtk_container_add (GTK_CONTAINER (box), grid);
label = gtk_label_new ("Start");
gtk_widget_set_halign (label, GTK_ALIGN_END);
@ -151,7 +152,7 @@ activate (GApplication *gapp)
gtk_grid_attach (GTK_GRID (grid), label, 0, 3, 1, 1);
gtk_grid_attach (GTK_GRID (grid), check, 1, 3, 1, 1);
gtk_box_pack_end (GTK_BOX (box), bar);
gtk_container_add (GTK_CONTAINER (box), bar);
gtk_container_add (GTK_CONTAINER (window), box);
gtk_widget_show (window);
}

View File

@ -325,7 +325,7 @@ open_valigned_label_window (void)
label = gtk_label_new ("Both labels expand");
gtk_widget_show (label);
gtk_box_pack_start (GTK_BOX (box), label);
gtk_container_add (GTK_CONTAINER (box), label);
label = gtk_label_new ("Some wrapping text with width-chars = 15 and max-width-chars = 35");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
@ -341,7 +341,7 @@ open_valigned_label_window (void)
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
gtk_widget_set_halign (frame, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (box), frame);
gtk_container_add (GTK_CONTAINER (box), frame);
gtk_window_present (GTK_WINDOW (window));
}

View File

@ -74,22 +74,22 @@ main (int argc,
gtk_container_add (GTK_CONTAINER (toplevel), box);
button = gtk_app_chooser_button_new ("image/jpeg");
gtk_box_pack_start (GTK_BOX (box), button);
gtk_container_add (GTK_CONTAINER (box), button);
g_signal_connect (button, "changed",
G_CALLBACK (combo_changed_cb), NULL);
w = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (w), "<b>Selected app info</b>");
gtk_box_pack_start (GTK_BOX (box), w);
gtk_container_add (GTK_CONTAINER (box), w);
w = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_box_pack_start (GTK_BOX (box), w);
gtk_container_add (GTK_CONTAINER (box), w);
sel_image = gtk_image_new ();
gtk_box_pack_start (GTK_BOX (w), sel_image);
gtk_container_add (GTK_CONTAINER (w), sel_image);
sel_name = gtk_label_new (NULL);
gtk_box_pack_start (GTK_BOX (w), sel_name);
gtk_container_add (GTK_CONTAINER (w), sel_name);
gtk_app_chooser_button_set_heading (GTK_APP_CHOOSER_BUTTON (button), "Choose one, <i>not</i> two");
gtk_app_chooser_button_append_separator (GTK_APP_CHOOSER_BUTTON (button));

View File

@ -377,13 +377,13 @@ create_nonlinear_assistant (GtkWidget *widget)
page = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
button = gtk_radio_button_new_with_label (NULL, "branch A");
gtk_box_pack_start (GTK_BOX (page), button);
gtk_container_add (GTK_CONTAINER (page), button);
g_signal_connect (G_OBJECT (button), "toggled", G_CALLBACK (select_branch), GINT_TO_POINTER ('A'));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
button = gtk_radio_button_new_with_label (gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)),
"branch B");
gtk_box_pack_start (GTK_BOX (page), button);
gtk_container_add (GTK_CONTAINER (page), button);
g_signal_connect (G_OBJECT (button), "toggled", G_CALLBACK (select_branch), GINT_TO_POINTER ('B'));
gtk_assistant_append_page (GTK_ASSISTANT (assistant), page);
@ -648,7 +648,7 @@ create_page_flipping_assistant (GtkWidget *widget)
gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), page, TRUE);
page = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_box_pack_start (GTK_BOX (page),
gtk_container_add (GTK_CONTAINER (page),
get_test_page ("Page 2"));
gtk_assistant_append_page (GTK_ASSISTANT (assistant), page);
gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), page, "Page 2");
@ -718,7 +718,7 @@ main (int argc, gchar *argv[])
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (buttons[i].func), NULL);
gtk_box_pack_start (GTK_BOX (box), button);
gtk_container_add (GTK_CONTAINER (box), button);
}
gtk_widget_show (window);

View File

@ -100,7 +100,7 @@ main (int argc,
for (j = 0; j < 2; j++)
{
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
char *aligns_names[] = { "FILL", "BASELINE" };
GtkAlign aligns[] = { GTK_ALIGN_FILL, GTK_ALIGN_BASELINE};
@ -140,7 +140,7 @@ main (int argc,
}
grid_hbox = hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
combo = gtk_combo_box_text_new ();
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), baseline_pos_str[0]);
@ -152,7 +152,7 @@ main (int argc,
for (j = 0; j < 2; j++)
{
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
g_signal_connect (G_OBJECT (combo), "changed",
G_CALLBACK (baseline_position_changed), hbox);
@ -225,7 +225,7 @@ main (int argc,
vbox, gtk_label_new ("grid"));
grid_hbox = hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
label = gtk_label_new ("Align me:");
gtk_widget_set_valign (label, GTK_ALIGN_BASELINE);
@ -292,7 +292,7 @@ main (int argc,
gtk_container_add (GTK_CONTAINER (hbox), grid);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
adjustment = gtk_adjustment_new (0.0, -1.0, 5.0, 1.0, 1.0, 0.0);
spin = gtk_spin_button_new (adjustment, 1.0, 0);
@ -317,7 +317,7 @@ main (int argc,
vbox, gtk_label_new ("button box"));
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
adjustment = gtk_adjustment_new (34.0, 1.0, 64.0, 1.0, 1.0, 0.0);
spin = gtk_spin_button_new (adjustment, 1.0, 0);
@ -330,7 +330,7 @@ main (int argc,
for (j = 0; j < 3; j++)
{
hbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
gtk_box_set_baseline_position (GTK_BOX (hbox), j);

View File

@ -129,7 +129,7 @@ main (int argc,
/* GtkHButtonBox */
hbbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
gtk_box_pack_start (GTK_BOX (vbox), hbbox);
gtk_container_add (GTK_CONTAINER (vbox), hbbox);
for (i = 0; i < N_BUTTONS; i++) {
buttons[i] = gtk_button_new_with_label (strings[i]);
@ -142,27 +142,27 @@ main (int argc,
/* GtkVButtonBox */
vbbox = gtk_button_box_new (GTK_ORIENTATION_VERTICAL);
gtk_box_pack_start (GTK_BOX (vbox), vbbox);
gtk_container_add (GTK_CONTAINER (vbox), vbbox);
/* Options */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
combo_types = gtk_combo_box_text_new ();
populate_combo_with (GTK_COMBO_BOX_TEXT (combo_types), types);
g_signal_connect (G_OBJECT (combo_types), "changed", G_CALLBACK (combo_types_changed_cb), buttons);
gtk_box_pack_start (GTK_BOX (hbox), combo_types);
gtk_container_add (GTK_CONTAINER (hbox), combo_types);
combo_styles = gtk_combo_box_text_new ();
populate_combo_with (GTK_COMBO_BOX_TEXT (combo_styles), styles);
g_signal_connect (G_OBJECT (combo_styles), "changed", G_CALLBACK (combo_changed_cb), NULL);
gtk_box_pack_start (GTK_BOX (hbox), combo_styles);
gtk_container_add (GTK_CONTAINER (hbox), combo_styles);
option = gtk_check_button_new_with_label ("Help is secondary");
g_signal_connect (G_OBJECT (option), "toggled", G_CALLBACK (option_cb), buttons[N_BUTTONS - 1]);
gtk_box_pack_start (GTK_BOX (hbox), option);
gtk_container_add (GTK_CONTAINER (hbox), option);
gtk_widget_show (window);
gtk_widget_hide (vbbox);

View File

@ -89,12 +89,12 @@ main (int argc, char *argv[])
gtk_container_add (GTK_CONTAINER (window), vbox);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (box), test_widget ("1"));
gtk_box_pack_start (GTK_BOX (box), test_widget ("2"));
gtk_box_pack_start (GTK_BOX (box), test_widget ("3"));
gtk_box_pack_start (GTK_BOX (box), test_widget ("4"));
gtk_box_pack_end (GTK_BOX (box), test_widget ("5"));
gtk_box_pack_end (GTK_BOX (box), test_widget ("6"));
gtk_container_add (GTK_CONTAINER (box), test_widget ("1"));
gtk_container_add (GTK_CONTAINER (box), test_widget ("2"));
gtk_container_add (GTK_CONTAINER (box), test_widget ("3"));
gtk_container_add (GTK_CONTAINER (box), test_widget ("4"));
gtk_container_add (GTK_CONTAINER (box), test_widget ("5"));
gtk_container_add (GTK_CONTAINER (box), test_widget ("6"));
gtk_container_add (GTK_CONTAINER (vbox), box);
@ -112,14 +112,14 @@ main (int argc, char *argv[])
gtk_widget_set_halign (b, GTK_ALIGN_CENTER);
label = gtk_label_new ("Spacing:");
gtk_widget_set_halign (label, GTK_ALIGN_END);
gtk_box_pack_start (GTK_BOX (b), label);
gtk_container_add (GTK_CONTAINER (b), label);
spin = gtk_spin_button_new_with_range (0, 10, 1);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spin), TRUE);
gtk_widget_set_halign (spin, GTK_ALIGN_START);
g_signal_connect (spin, "value-changed",
G_CALLBACK (spacing_changed), box);
gtk_box_pack_start (GTK_BOX (b), spin);
gtk_container_add (GTK_CONTAINER (b), spin);
gtk_container_add (GTK_CONTAINER (vbox), b);
gtk_widget_show (window);

View File

@ -169,10 +169,10 @@ main (gint argc, gchar **argv)
toolbar = gtk_toolbar_new ();
gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_TEXT);
gtk_box_pack_start (GTK_BOX (main_box), toolbar);
gtk_container_add (GTK_CONTAINER (main_box), toolbar);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (main_box), box);
gtk_container_add (GTK_CONTAINER (main_box), box);
container = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_min_content_width (GTK_SCROLLED_WINDOW (container), 200);
@ -194,28 +194,30 @@ main (gint argc, gchar **argv)
gtk_text_view_get_buffer (GTK_TEXT_VIEW (child)));
container = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (main_box), container);
gtk_container_add (GTK_CONTAINER (main_box), container);
child = gtk_switch_new ();
gtk_switch_set_active (GTK_SWITCH (child), gtk_widget_get_default_direction () == GTK_TEXT_DIR_LTR);
g_signal_connect (child,
"notify::active",
G_CALLBACK (set_orientation),
NULL);
gtk_box_pack_start (GTK_BOX (container), child);
gtk_container_add (GTK_CONTAINER (container), child);
child = gtk_label_new ("left-to-right");
gtk_box_pack_start (GTK_BOX (container), child);
child = gtk_button_new_with_label ("Add button");
g_signal_connect_swapped (child,
"clicked",
G_CALLBACK (add_button),
box);
gtk_box_pack_end (GTK_BOX (container), child);
gtk_widget_set_hexpand (child, TRUE);
gtk_widget_set_halign (child, GTK_ALIGN_START);
gtk_container_add (GTK_CONTAINER (container), child);
child = gtk_button_new_with_label ("Add toolbutton");
g_signal_connect_swapped (child,
"clicked",
G_CALLBACK (add_toolbutton),
toolbar);
gtk_box_pack_end (GTK_BOX (container), child);
gtk_container_add (GTK_CONTAINER (container), child);
child = gtk_button_new_with_label ("Add button");
g_signal_connect_swapped (child,
"clicked",
G_CALLBACK (add_button),
box);
gtk_container_add (GTK_CONTAINER (container), child);
add_toolbutton (GTK_TOOLBAR (toolbar));
add_toolbutton (GTK_TOOLBAR (toolbar));

View File

@ -491,7 +491,7 @@ create_calendar(void)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, DEF_PAD_SMALL);
frame = create_frame ("<b>Options</b>", vbox, GTK_ALIGN_FILL, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (rpane), frame);
gtk_container_add (GTK_CONTAINER (rpane), frame);
size = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
context = gtk_widget_get_style_context (calendar);
@ -512,9 +512,9 @@ create_calendar(void)
gtk_size_group_add_widget (size, label);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, DEF_PAD_SMALL);
gtk_box_pack_start (GTK_BOX (hbox), label);
gtk_box_pack_start (GTK_BOX (hbox), button);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (hbox), label);
gtk_container_add (GTK_CONTAINER (hbox), button);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
/* Build the width entry */
@ -533,9 +533,9 @@ create_calendar(void)
gtk_size_group_add_widget (size, label);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, DEF_PAD_SMALL);
gtk_box_pack_start (GTK_BOX (hbox), label);
gtk_box_pack_start (GTK_BOX (hbox), button);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (hbox), label);
gtk_container_add (GTK_CONTAINER (hbox), button);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
/* Build the height entry */
@ -554,15 +554,15 @@ create_calendar(void)
gtk_size_group_add_widget (size, label);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, DEF_PAD_SMALL);
gtk_box_pack_start (GTK_BOX (hbox), label);
gtk_box_pack_start (GTK_BOX (hbox), button);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (hbox), label);
gtk_container_add (GTK_CONTAINER (hbox), button);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
/* Build the right details frame */
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, DEF_PAD_SMALL);
frame = create_frame ("<b>Details</b>", vbox, GTK_ALIGN_FILL, GTK_ALIGN_FILL);
gtk_box_pack_start (GTK_BOX (rpane), frame);
gtk_container_add (GTK_CONTAINER (rpane), frame);
details = gtk_text_view_new();
calendar_data.details_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (details));
@ -580,12 +580,12 @@ create_calendar(void)
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (vbox), scroller);
gtk_container_add (GTK_CONTAINER (vbox), scroller);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, DEF_PAD_SMALL);
gtk_widget_set_halign (hbox, GTK_ALIGN_START);
gtk_widget_set_valign (hbox, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
button = gtk_button_new_with_mnemonic ("Demonstrate _Details");
@ -594,7 +594,7 @@ create_calendar(void)
G_CALLBACK (demonstrate_details),
&calendar_data);
gtk_box_pack_start (GTK_BOX (hbox), button);
gtk_container_add (GTK_CONTAINER (hbox), button);
button = gtk_button_new_with_mnemonic ("_Reset Details");
@ -603,24 +603,24 @@ create_calendar(void)
G_CALLBACK (reset_details),
&calendar_data);
gtk_box_pack_start (GTK_BOX (hbox), button);
gtk_container_add (GTK_CONTAINER (hbox), button);
toggle = gtk_check_button_new_with_mnemonic ("_Use Details");
g_signal_connect (toggle, "toggled",
G_CALLBACK(calendar_toggle_details),
&calendar_data);
gtk_box_pack_start (GTK_BOX (vbox), toggle);
gtk_container_add (GTK_CONTAINER (vbox), toggle);
/* Build the Right frame with the flags in */
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
frame = create_expander ("<b>Flags</b>", vbox, GTK_ALIGN_FILL, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (rpane), frame);
gtk_container_add (GTK_CONTAINER (rpane), frame);
for (i = 0; i < G_N_ELEMENTS (calendar_data.settings); i++)
{
toggle = gtk_check_button_new_with_mnemonic(flags[i].label);
gtk_box_pack_start (GTK_BOX (vbox), toggle);
gtk_container_add (GTK_CONTAINER (vbox), toggle);
calendar_data.flag_checkboxes[i] = toggle;
g_signal_connect (toggle, "toggled",
@ -639,25 +639,25 @@ create_calendar(void)
frame = create_frame ("<b>Signal Events</b>", vbox, GTK_ALIGN_FILL, GTK_ALIGN_CENTER);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
label = gtk_label_new ("Signal:");
gtk_box_pack_start (GTK_BOX (hbox), label);
gtk_container_add (GTK_CONTAINER (hbox), label);
calendar_data.last_sig = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (hbox), calendar_data.last_sig);
gtk_container_add (GTK_CONTAINER (hbox), calendar_data.last_sig);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
label = gtk_label_new ("Previous signal:");
gtk_box_pack_start (GTK_BOX (hbox), label);
gtk_container_add (GTK_CONTAINER (hbox), label);
calendar_data.prev_sig = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (hbox), calendar_data.prev_sig);
gtk_container_add (GTK_CONTAINER (hbox), calendar_data.prev_sig);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
label = gtk_label_new ("Second previous signal:");
gtk_box_pack_start (GTK_BOX (hbox), label);
gtk_container_add (GTK_CONTAINER (hbox), label);
calendar_data.prev2_sig = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (hbox), calendar_data.prev2_sig);
gtk_container_add (GTK_CONTAINER (hbox), calendar_data.prev2_sig);
/*
* Glue everything together
@ -672,11 +672,11 @@ create_calendar(void)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, DEF_PAD_SMALL);
gtk_box_pack_start (GTK_BOX (vbox), hpaned);
gtk_box_pack_start (GTK_BOX (vbox), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL));
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_box_pack_start (GTK_BOX (vbox), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL));
gtk_box_pack_start (GTK_BOX (vbox), bbox);
gtk_container_add (GTK_CONTAINER (vbox), hpaned);
gtk_container_add (GTK_CONTAINER (vbox), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL));
gtk_container_add (GTK_CONTAINER (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL));
gtk_container_add (GTK_CONTAINER (vbox), bbox);
gtk_container_add (GTK_CONTAINER (window), vbox);

View File

@ -195,20 +195,18 @@ simple_cell_area (void)
gtk_container_add (GTK_CONTAINER (frame), iconview);
gtk_box_pack_end (GTK_BOX (hbox), frame);
/* Now add some controls */
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 4);
gtk_widget_show (vbox);
gtk_box_pack_end (GTK_BOX (hbox), vbox);
gtk_container_add (GTK_CONTAINER (hbox), vbox);
gtk_container_add (GTK_CONTAINER (hbox), frame);
widget = gtk_combo_box_text_new ();
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Horizontal");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Vertical");
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
gtk_widget_show (widget);
gtk_box_pack_start (GTK_BOX (vbox), widget);
gtk_container_add (GTK_CONTAINER (vbox), widget);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (orientation_changed), iconview);
@ -216,7 +214,7 @@ simple_cell_area (void)
widget = gtk_check_button_new_with_label ("Align 2nd Cell");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE);
gtk_widget_show (widget);
gtk_box_pack_start (GTK_BOX (vbox), widget);
gtk_container_add (GTK_CONTAINER (vbox), widget);
g_signal_connect (G_OBJECT (widget), "toggled",
G_CALLBACK (align_cell_2_toggled), iconview);
@ -224,7 +222,7 @@ simple_cell_area (void)
widget = gtk_check_button_new_with_label ("Align 3rd Cell");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
gtk_widget_show (widget);
gtk_box_pack_start (GTK_BOX (vbox), widget);
gtk_container_add (GTK_CONTAINER (vbox), widget);
g_signal_connect (G_OBJECT (widget), "toggled",
G_CALLBACK (align_cell_3_toggled), iconview);
@ -233,7 +231,7 @@ simple_cell_area (void)
widget = gtk_check_button_new_with_label ("Expand 1st Cell");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE);
gtk_widget_show (widget);
gtk_box_pack_start (GTK_BOX (vbox), widget);
gtk_container_add (GTK_CONTAINER (vbox), widget);
g_signal_connect (G_OBJECT (widget), "toggled",
G_CALLBACK (expand_cell_1_toggled), iconview);
@ -241,7 +239,7 @@ simple_cell_area (void)
widget = gtk_check_button_new_with_label ("Expand 2nd Cell");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
gtk_widget_show (widget);
gtk_box_pack_start (GTK_BOX (vbox), widget);
gtk_container_add (GTK_CONTAINER (vbox), widget);
g_signal_connect (G_OBJECT (widget), "toggled",
G_CALLBACK (expand_cell_2_toggled), iconview);
@ -249,7 +247,7 @@ simple_cell_area (void)
widget = gtk_check_button_new_with_label ("Expand 3rd Cell");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE);
gtk_widget_show (widget);
gtk_box_pack_start (GTK_BOX (vbox), widget);
gtk_container_add (GTK_CONTAINER (vbox), widget);
g_signal_connect (G_OBJECT (widget), "toggled",
G_CALLBACK (expand_cell_3_toggled), iconview);
@ -441,19 +439,17 @@ focus_cell_area (void)
gtk_container_add (GTK_CONTAINER (frame), iconview);
gtk_box_pack_end (GTK_BOX (hbox), frame);
/* Now add some controls */
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 4);
gtk_widget_show (vbox);
gtk_box_pack_end (GTK_BOX (hbox), vbox);
gtk_container_add (GTK_CONTAINER (hbox), vbox);
gtk_container_add (GTK_CONTAINER (hbox), frame);
widget = gtk_combo_box_text_new ();
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Horizontal");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Vertical");
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
gtk_widget_show (widget);
gtk_box_pack_start (GTK_BOX (vbox), widget);
gtk_container_add (GTK_CONTAINER (vbox), widget);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (orientation_changed), iconview);
@ -461,7 +457,7 @@ focus_cell_area (void)
widget = gtk_check_button_new_with_label ("Focus Sibling");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
gtk_widget_show (widget);
gtk_box_pack_start (GTK_BOX (vbox), widget);
gtk_container_add (GTK_CONTAINER (vbox), widget);
g_signal_connect (G_OBJECT (widget), "toggled",
G_CALLBACK (focus_sibling_toggled), iconview);
@ -530,8 +526,7 @@ background_area (void)
"prepended space distributed to the background area.");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_width_chars (GTK_LABEL (label), 40);
gtk_widget_show (label);
gtk_box_pack_start (GTK_BOX (main_vbox), label);
gtk_container_add (GTK_CONTAINER (main_vbox), label);
iconview = focus_iconview (TRUE, NULL, NULL);
@ -543,20 +538,20 @@ background_area (void)
gtk_container_add (GTK_CONTAINER (frame), iconview);
gtk_box_pack_end (GTK_BOX (hbox), frame);
/* Now add some controls */
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 4);
gtk_widget_show (vbox);
gtk_box_pack_end (GTK_BOX (hbox), vbox);
gtk_box_pack_start (GTK_BOX (main_vbox), hbox);
gtk_container_add (GTK_CONTAINER (hbox), vbox);
gtk_container_add (GTK_CONTAINER (hbox), frame);
gtk_container_add (GTK_CONTAINER (main_vbox), hbox);
widget = gtk_combo_box_text_new ();
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Horizontal");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Vertical");
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
gtk_widget_show (widget);
gtk_box_pack_start (GTK_BOX (vbox), widget);
gtk_container_add (GTK_CONTAINER (vbox), widget);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (orientation_changed), iconview);
@ -565,9 +560,9 @@ background_area (void)
label = gtk_label_new ("Cell spacing");
gtk_widget_set_hexpand (label, TRUE);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
gtk_box_pack_start (GTK_BOX (hbox), label);
gtk_box_pack_start (GTK_BOX (hbox), widget);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (hbox), label);
gtk_container_add (GTK_CONTAINER (hbox), widget);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
g_signal_connect (G_OBJECT (widget), "value-changed",
G_CALLBACK (cell_spacing_changed), iconview);
@ -578,9 +573,9 @@ background_area (void)
label = gtk_label_new ("Row spacing");
gtk_widget_set_hexpand (label, TRUE);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
gtk_box_pack_start (GTK_BOX (hbox), label);
gtk_box_pack_start (GTK_BOX (hbox), widget);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (hbox), label);
gtk_container_add (GTK_CONTAINER (hbox), widget);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
g_signal_connect (G_OBJECT (widget), "value-changed",
G_CALLBACK (row_spacing_changed), iconview);
@ -590,9 +585,9 @@ background_area (void)
gtk_widget_set_hexpand (label, TRUE);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), gtk_icon_view_get_item_padding (GTK_ICON_VIEW (iconview)));
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
gtk_box_pack_start (GTK_BOX (hbox), label);
gtk_box_pack_start (GTK_BOX (hbox), widget);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (hbox), label);
gtk_container_add (GTK_CONTAINER (hbox), widget);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
g_signal_connect (G_OBJECT (widget), "value-changed",
G_CALLBACK (item_padding_changed), iconview);

View File

@ -266,20 +266,20 @@ main (int argc, char **argv)
/* LTR */
label = gtk_label_new ("Left to right");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
tree = create_tree (FALSE);
gtk_widget_set_vexpand (tree, TRUE);
gtk_box_pack_start (GTK_BOX (vbox), tree);
gtk_container_add (GTK_CONTAINER (vbox), tree);
/* RTL */
label = gtk_label_new ("Right to left");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
tree = create_tree (TRUE);
gtk_widget_set_vexpand (tree, TRUE);
gtk_box_pack_start (GTK_BOX (vbox), tree);
gtk_container_add (GTK_CONTAINER (vbox), tree);
gtk_widget_show (window);
gtk_main ();

View File

@ -1075,7 +1075,7 @@ main (int argc, char **argv)
/* GtkCellView */
tmp = gtk_frame_new ("GtkCellView");
gtk_box_pack_start (GTK_BOX (mainbox), tmp);
gtk_container_add (GTK_CONTAINER (mainbox), tmp);
boom = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (tmp), boom);
@ -1096,7 +1096,7 @@ main (int argc, char **argv)
/* GtkComboBox list */
tmp = gtk_frame_new ("GtkComboBox (list)");
gtk_box_pack_start (GTK_BOX (mainbox), tmp);
gtk_container_add (GTK_CONTAINER (mainbox), tmp);
boom = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (tmp), boom);
@ -1136,7 +1136,7 @@ main (int argc, char **argv)
/* GtkComboBox dynamic list */
tmp = gtk_frame_new ("GtkComboBox (dynamic list)");
gtk_box_pack_start (GTK_BOX (mainbox), tmp);
gtk_container_add (GTK_CONTAINER (mainbox), tmp);
boom = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (tmp), boom);
@ -1179,7 +1179,7 @@ main (int argc, char **argv)
/* GtkComboBox custom entry */
tmp = gtk_frame_new ("GtkComboBox (custom)");
gtk_box_pack_start (GTK_BOX (mainbox), tmp);
gtk_container_add (GTK_CONTAINER (mainbox), tmp);
boom = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (tmp), boom);
@ -1233,7 +1233,7 @@ main (int argc, char **argv)
/* GtkComboBox tree */
tmp = gtk_frame_new ("GtkComboBox (tree)");
gtk_box_pack_start (GTK_BOX (mainbox), tmp);
gtk_container_add (GTK_CONTAINER (mainbox), tmp);
boom = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (tmp), boom);
@ -1276,18 +1276,18 @@ main (int argc, char **argv)
/* GtkComboBox (grid mode) */
tmp = gtk_frame_new ("GtkComboBox (grid mode)");
gtk_box_pack_start (GTK_BOX (mainbox), tmp);
gtk_container_add (GTK_CONTAINER (mainbox), tmp);
boom = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (tmp), boom);
comboboxgrid = create_combo_box_grid_demo ();
gtk_box_pack_start (GTK_BOX (boom), comboboxgrid);
gtk_container_add (GTK_CONTAINER (boom), comboboxgrid);
/* GtkComboBoxEntry */
tmp = gtk_frame_new ("GtkComboBox with entry");
gtk_box_pack_start (GTK_BOX (mainbox), tmp);
gtk_container_add (GTK_CONTAINER (mainbox), tmp);
boom = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (tmp), boom);
@ -1299,7 +1299,7 @@ main (int argc, char **argv)
/* Phylogenetic tree */
tmp = gtk_frame_new ("What are you ?");
gtk_box_pack_start (GTK_BOX (mainbox), tmp);
gtk_container_add (GTK_CONTAINER (mainbox), tmp);
boom = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (tmp), boom);
@ -1321,7 +1321,7 @@ main (int argc, char **argv)
/* Capitals */
tmp = gtk_frame_new ("Where are you ?");
gtk_box_pack_start (GTK_BOX (mainbox), tmp);
gtk_container_add (GTK_CONTAINER (mainbox), tmp);
boom = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (tmp), boom);
@ -1352,7 +1352,7 @@ main (int argc, char **argv)
/* Aligned Food */
tmp = gtk_frame_new ("Hungry ?");
gtk_box_pack_start (GTK_BOX (mainbox), tmp);
gtk_container_add (GTK_CONTAINER (mainbox), tmp);
boom = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (tmp), boom);
@ -1386,7 +1386,7 @@ main (int argc, char **argv)
/* Ellipsizing growing combos */
tmp = gtk_frame_new ("Unconstrained Menu");
gtk_box_pack_start (GTK_BOX (mainbox), tmp);
gtk_container_add (GTK_CONTAINER (mainbox), tmp);
boom = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (tmp), boom);
@ -1405,7 +1405,7 @@ main (int argc, char **argv)
gtk_combo_box_set_popup_fixed_width (GTK_COMBO_BOX (combobox), FALSE);
tmp = gtk_frame_new ("Looong");
gtk_box_pack_start (GTK_BOX (mainbox), tmp);
gtk_container_add (GTK_CONTAINER (mainbox), tmp);
combobox = gtk_combo_box_text_new ();
for (i = 0; i < 200; i++)
{

View File

@ -247,30 +247,30 @@ main (int argc, char **argv)
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_box_pack_start (GTK_BOX (content_area), hbox);
gtk_container_add (GTK_CONTAINER (content_area), hbox);
combo_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
gtk_box_pack_start (GTK_BOX (hbox), combo_vbox);
gtk_container_add (GTK_CONTAINER (hbox), combo_vbox);
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label), "<b>Menu mode</b>");
gtk_box_pack_start (GTK_BOX (combo_vbox), label);
gtk_container_add (GTK_CONTAINER (combo_vbox), label);
menu_combo = create_combo ("menu-combo", FALSE);
gtk_widget_set_margin_start (menu_combo, 12);
gtk_box_pack_start (GTK_BOX (combo_vbox), menu_combo);
gtk_container_add (GTK_CONTAINER (combo_vbox), menu_combo);
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label), "<b>List mode</b>");
gtk_box_pack_start (GTK_BOX (combo_vbox), label);
gtk_container_add (GTK_CONTAINER (combo_vbox), label);
list_combo = create_combo ("list-combo", TRUE);
gtk_widget_set_margin_start (list_combo, 12);
gtk_box_pack_start (GTK_BOX (combo_vbox), list_combo);
gtk_container_add (GTK_CONTAINER (combo_vbox), list_combo);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_set_hexpand (scrolled_window, TRUE);
gtk_box_pack_start (GTK_BOX (hbox), scrolled_window);
gtk_container_add (GTK_CONTAINER (hbox), scrolled_window);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
@ -281,24 +281,24 @@ main (int argc, char **argv)
gtk_container_add (GTK_CONTAINER (scrolled_window), text_view);
button_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
gtk_box_pack_start (GTK_BOX (hbox), button_vbox);
gtk_container_add (GTK_CONTAINER (hbox), button_vbox);
gtk_window_set_default_size (GTK_WINDOW (dialog), 500, 300);
button = gtk_button_new_with_label ("Insert");
gtk_box_pack_start (GTK_BOX (button_vbox), button);
gtk_container_add (GTK_CONTAINER (button_vbox), button);
g_signal_connect (button, "clicked", G_CALLBACK (on_insert), NULL);
button = gtk_button_new_with_label ("Delete");
gtk_box_pack_start (GTK_BOX (button_vbox), button);
gtk_container_add (GTK_CONTAINER (button_vbox), button);
g_signal_connect (button, "clicked", G_CALLBACK (on_delete), NULL);
button = gtk_button_new_with_label ("Reorder");
gtk_box_pack_start (GTK_BOX (button_vbox), button);
gtk_container_add (GTK_CONTAINER (button_vbox), button);
g_signal_connect (button, "clicked", G_CALLBACK (on_reorder), NULL);
button = gtk_button_new_with_label ("Animate");
gtk_box_pack_start (GTK_BOX (button_vbox), button);
gtk_container_add (GTK_CONTAINER (button_vbox), button);
g_signal_connect (button, "clicked", G_CALLBACK (on_animate), NULL);
gtk_widget_show (dialog);

View File

@ -131,9 +131,9 @@ main (int argc, char *argv[])
gtk_widget_set_vexpand (overlay, TRUE);
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), label);
gtk_box_pack_start (GTK_BOX (vbox), combo);
gtk_box_pack_start (GTK_BOX (vbox), scale);
gtk_box_pack_start (GTK_BOX (vbox), overlay);
gtk_container_add (GTK_CONTAINER (vbox), combo);
gtk_container_add (GTK_CONTAINER (vbox), scale);
gtk_container_add (GTK_CONTAINER (vbox), overlay);
g_object_set_data (G_OBJECT (label), "combo", combo);

View File

@ -307,7 +307,7 @@ main (int argc, char *argv[])
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label), "Completion demo, try writing <b>total</b> or <b>gnome</b> for example.");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
/* Create our first entry */
entry = gtk_entry_new ();
@ -392,7 +392,7 @@ main (int argc, char *argv[])
g_timeout_add (1000, (GSourceFunc) animation_timer, completion);
/* Fourth entry */
gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new ("Model-less entry completion"));
gtk_container_add (GTK_CONTAINER (vbox), gtk_label_new ("Model-less entry completion"));
entry = gtk_entry_new ();

View File

@ -53,24 +53,22 @@ create_box_window (void)
box2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
box3 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_box_pack_start (GTK_BOX (box1),
gtk_container_add (GTK_CONTAINER (box1),
gtk_label_new ("VBox 1 Top"));
gtk_box_pack_start (GTK_BOX (box1),
gtk_container_add (GTK_CONTAINER (box1),
box2);
gtk_box_pack_end (GTK_BOX (box1),
gtk_label_new ("VBox 1 Bottom"));
gtk_container_add (GTK_CONTAINER(box1),
gtk_label_new ("VBox 1 Bottom"));
gtk_box_pack_start (GTK_BOX (box2),
gtk_container_add (GTK_CONTAINER (box2),
gtk_label_new ("HBox 2 Left"));
gtk_box_pack_start (GTK_BOX (box2),
gtk_container_add (GTK_CONTAINER (box2),
box3);
gtk_box_pack_end (GTK_BOX (box2),
gtk_label_new ("HBox 2 Right"));
gtk_container_add (GTK_CONTAINER(box2),
gtk_label_new ("HBox 2 Right"));
gtk_box_pack_start (GTK_BOX (box3),
gtk_container_add (GTK_CONTAINER (box3),
gtk_label_new ("VBox 3 Top"));
gtk_box_pack_end (GTK_BOX (box3),
gtk_label_new ("VBox 3 Bottom"));
colorbox = gtk_frame_new (NULL);
@ -82,7 +80,7 @@ create_box_window (void)
G_CALLBACK (on_toggle_hexpand), NULL);
gtk_container_add (GTK_CONTAINER (colorbox), toggle);
gtk_box_pack_start (GTK_BOX (box3), colorbox);
gtk_container_add (GTK_CONTAINER (box3), colorbox);
colorbox = gtk_frame_new (NULL);
@ -93,7 +91,9 @@ create_box_window (void)
g_signal_connect (G_OBJECT (toggle), "toggled",
G_CALLBACK (on_toggle_vexpand), NULL);
gtk_container_add (GTK_CONTAINER (colorbox), toggle);
gtk_box_pack_start (GTK_BOX (box3), colorbox);
gtk_container_add (GTK_CONTAINER (box3), colorbox);
gtk_container_add (GTK_CONTAINER (box3),
gtk_label_new ("VBox 3 Bottom"));
gtk_container_add (GTK_CONTAINER (window), box1);
gtk_widget_show (window);

View File

@ -9,8 +9,6 @@ expander_cb (GtkExpander *expander, GParamSpec *pspec, GtkWindow *dialog)
static void
do_not_expand (GtkWidget *child, gpointer data)
{
gtk_container_child_set (GTK_CONTAINER (gtk_widget_get_parent (child)), child,
"expand", FALSE, "fill", FALSE, NULL);
}
static void
@ -24,7 +22,6 @@ main (int argc, char *argv[])
{
GtkWidget *dialog;
GtkWidget *area;
GtkWidget *box;
GtkWidget *expander;
GtkWidget *sw;
GtkWidget *tv;
@ -43,10 +40,6 @@ main (int argc, char *argv[])
"but not the full story.");
area = gtk_message_dialog_get_message_area (GTK_MESSAGE_DIALOG (dialog));
/* make the hbox expand */
box = gtk_widget_get_parent (area);
gtk_container_child_set (GTK_CONTAINER (gtk_widget_get_parent (box)), box,
"expand", TRUE, "fill", TRUE, NULL);
/* make the labels not expand */
gtk_container_foreach (GTK_CONTAINER (area), do_not_expand, NULL);
@ -74,7 +67,7 @@ main (int argc, char *argv[])
gtk_container_add (GTK_CONTAINER (expander), sw);
gtk_widget_set_hexpand (expander, TRUE);
gtk_widget_set_vexpand (expander, TRUE);
gtk_box_pack_end (GTK_BOX (area), expander);
gtk_container_add (GTK_CONTAINER (area), expander);
g_signal_connect (expander, "notify::expanded",
G_CALLBACK (expander_cb), dialog);

View File

@ -663,11 +663,11 @@ main (int argc, char **argv)
gtk_file_chooser_set_preview_widget (GTK_FILE_CHOOSER (dialog), preview_vbox);
preview_label = gtk_label_new (NULL);
gtk_box_pack_start (GTK_BOX (preview_vbox), preview_label, TRUE, TRUE, 0);
gtk_container_add (GTK_CONTAINER (preview_vbox), preview_label, TRUE, TRUE, 0);
g_object_set (preview_label, "margin", 6, NULL);
preview_image = gtk_image_new ();
gtk_box_pack_start (GTK_BOX (preview_vbox), preview_image, TRUE, TRUE, 0);
gtk_container_add (GTK_CONTAINER (preview_vbox), preview_image, TRUE, TRUE, 0);
g_object_set (preview_image, "margin", 6, NULL);
update_preview_cb (GTK_FILE_CHOOSER (dialog));

View File

@ -124,25 +124,25 @@ tests_button_clicked_cb (GtkButton *real_button,
button = gtk_button_new_with_label ("Print Selected Path");
g_signal_connect (button, "clicked",
G_CALLBACK (print_selected_path_clicked_cb), user_data);
gtk_box_pack_start (GTK_BOX (box), button);
gtk_container_add (GTK_CONTAINER (box), button);
gtk_widget_show (button);
button = gtk_button_new_with_label ("Add $PWD's Parent as Shortcut");
g_signal_connect (button, "clicked",
G_CALLBACK (add_pwds_parent_as_shortcut_clicked_cb), user_data);
gtk_box_pack_start (GTK_BOX (box), button);
gtk_container_add (GTK_CONTAINER (box), button);
gtk_widget_show (button);
button = gtk_button_new_with_label ("Remove $PWD's Parent as Shortcut");
g_signal_connect (button, "clicked",
G_CALLBACK (del_pwds_parent_as_shortcut_clicked_cb), user_data);
gtk_box_pack_start (GTK_BOX (box), button);
gtk_container_add (GTK_CONTAINER (box), button);
gtk_widget_show (button);
button = gtk_button_new_with_label ("Unselect all");
g_signal_connect (button, "clicked",
G_CALLBACK (unselect_all_clicked_cb), user_data);
gtk_box_pack_start (GTK_BOX (box), button);
gtk_container_add (GTK_CONTAINER (box), button);
gtk_widget_show (button);
g_object_set_data (user_data, "tests-dialog", tests);
@ -216,12 +216,12 @@ add_new_filechooser_button (const gchar *mnemonic,
GtkWidget *hbox, *label, *chooser, *button;
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_box_pack_start (GTK_BOX (group_box), hbox);
gtk_container_add (GTK_CONTAINER (group_box), hbox);
label = gtk_label_new_with_mnemonic (mnemonic);
gtk_size_group_add_widget (GTK_SIZE_GROUP (label_group), label);
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
gtk_box_pack_start (GTK_BOX (hbox), label);
gtk_container_add (GTK_CONTAINER (hbox), label);
chooser = gtk_file_chooser_button_new (g_strconcat(chooser_title,
" - testfilechooserbutton", NULL),
@ -235,11 +235,11 @@ add_new_filechooser_button (const gchar *mnemonic,
g_signal_connect (chooser, "selection-changed", G_CALLBACK (chooser_selection_changed_cb), NULL);
g_signal_connect (chooser, "file-activated", G_CALLBACK (chooser_file_activated_cb), NULL);
g_signal_connect (chooser, "update-preview", G_CALLBACK (chooser_update_preview_cb), NULL);
gtk_box_pack_start (GTK_BOX (hbox), chooser);
gtk_container_add (GTK_CONTAINER (hbox), chooser);
button = gtk_button_new_with_label ("Tests");
g_signal_connect (button, "clicked", G_CALLBACK (tests_button_clicked_cb), chooser);
gtk_box_pack_start (GTK_BOX (hbox), button);
gtk_container_add (GTK_CONTAINER (hbox), button);
}
@ -278,7 +278,7 @@ main (int argc,
frame = gtk_frame_new ("<b>GtkFileChooserButton</b>");
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
gtk_label_set_use_markup (GTK_LABEL (gtk_frame_get_label_widget (GTK_FRAME (frame))), TRUE);
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
gtk_widget_set_halign (frame, GTK_ALIGN_FILL);
gtk_widget_set_valign (frame, GTK_ALIGN_FILL);

View File

@ -386,7 +386,7 @@ create_window (void)
gtk_widget_show (vbox);
gtk_widget_show (hbox);
gtk_container_add (GTK_CONTAINER (window), hbox);
gtk_box_pack_start (GTK_BOX (hbox), vbox);
gtk_container_add (GTK_CONTAINER (hbox), vbox);
swindow = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_set_hexpand (swindow, TRUE);
@ -394,7 +394,7 @@ create_window (void)
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_widget_show (swindow);
gtk_box_pack_start (GTK_BOX (hbox), swindow);
gtk_container_add (GTK_CONTAINER (hbox), swindow);
flowbox = gtk_flow_box_new ();
gtk_widget_set_halign (flowbox, GTK_ALIGN_END);
@ -423,14 +423,14 @@ create_window (void)
gtk_widget_show (flowbox_cntl);
gtk_widget_show (expander);
gtk_container_add (GTK_CONTAINER (expander), flowbox_cntl);
gtk_box_pack_start (GTK_BOX (vbox), expander);
gtk_container_add (GTK_CONTAINER (vbox), expander);
widget = gtk_check_button_new_with_label ("Homogeneous");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE);
gtk_widget_show (widget);
gtk_widget_set_tooltip_text (widget, "Set whether the items should be displayed at the same size");
gtk_box_pack_start (GTK_BOX (flowbox_cntl), widget);
gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget);
g_signal_connect (G_OBJECT (widget), "toggled",
G_CALLBACK (homogeneous_toggled), flowbox);
@ -441,7 +441,7 @@ create_window (void)
flowbox, "activate-on-single-click",
G_BINDING_SYNC_CREATE);
gtk_widget_show (widget);
gtk_box_pack_start (GTK_BOX (flowbox_cntl), widget);
gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget);
/* Add alignment controls */
widget = gtk_combo_box_text_new ();
@ -453,7 +453,7 @@ create_window (void)
gtk_widget_show (widget);
gtk_widget_set_tooltip_text (widget, "Set the horizontal alignment policy");
gtk_box_pack_start (GTK_BOX (flowbox_cntl), widget);
gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (horizontal_alignment_changed), flowbox);
@ -467,7 +467,7 @@ create_window (void)
gtk_widget_show (widget);
gtk_widget_set_tooltip_text (widget, "Set the vertical alignment policy");
gtk_box_pack_start (GTK_BOX (flowbox_cntl), widget);
gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (vertical_alignment_changed), flowbox);
@ -480,7 +480,7 @@ create_window (void)
gtk_widget_show (widget);
gtk_widget_set_tooltip_text (widget, "Set the flowbox orientation");
gtk_box_pack_start (GTK_BOX (flowbox_cntl), widget);
gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (orientation_changed), flowbox);
@ -495,7 +495,7 @@ create_window (void)
gtk_widget_show (widget);
gtk_widget_set_tooltip_text (widget, "Set the selection mode");
gtk_box_pack_start (GTK_BOX (flowbox_cntl), widget);
gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (selection_mode_changed), flowbox);
@ -506,7 +506,7 @@ create_window (void)
gtk_widget_show (widget);
gtk_widget_set_tooltip_text (widget, "Set the minimum amount of items per line before wrapping");
gtk_box_pack_start (GTK_BOX (flowbox_cntl), widget);
gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (line_length_changed), flowbox);
@ -519,7 +519,7 @@ create_window (void)
gtk_widget_show (widget);
gtk_widget_set_tooltip_text (widget, "Set the natural amount of items per line ");
gtk_box_pack_start (GTK_BOX (flowbox_cntl), widget);
gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (max_line_length_changed), flowbox);
@ -531,41 +531,41 @@ create_window (void)
gtk_widget_show (hbox);
widget = gtk_label_new ("H Spacing");
gtk_box_pack_start (GTK_BOX (hbox), widget);
gtk_container_add (GTK_CONTAINER (hbox), widget);
widget = gtk_spin_button_new_with_range (0, 30, 1);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), INITIAL_CSPACING);
gtk_widget_show (widget);
gtk_widget_set_tooltip_text (widget, "Set the horizontal spacing between children");
gtk_box_pack_start (GTK_BOX (hbox), widget);
gtk_container_add (GTK_CONTAINER (hbox), widget);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (spacing_changed), GINT_TO_POINTER (GTK_ORIENTATION_HORIZONTAL));
g_signal_connect (G_OBJECT (widget), "value-changed",
G_CALLBACK (spacing_changed), GINT_TO_POINTER (GTK_ORIENTATION_HORIZONTAL));
gtk_box_pack_start (GTK_BOX (flowbox_cntl), hbox);
gtk_container_add (GTK_CONTAINER (flowbox_cntl), hbox);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
gtk_widget_show (hbox);
widget = gtk_label_new ("V Spacing");
gtk_box_pack_start (GTK_BOX (hbox), widget);
gtk_container_add (GTK_CONTAINER (hbox), widget);
widget = gtk_spin_button_new_with_range (0, 30, 1);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), INITIAL_RSPACING);
gtk_widget_show (widget);
gtk_widget_set_tooltip_text (widget, "Set the vertical spacing between children");
gtk_box_pack_start (GTK_BOX (hbox), widget);
gtk_container_add (GTK_CONTAINER (hbox), widget);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (spacing_changed), GINT_TO_POINTER (GTK_ORIENTATION_VERTICAL));
g_signal_connect (G_OBJECT (widget), "value-changed",
G_CALLBACK (spacing_changed), GINT_TO_POINTER (GTK_ORIENTATION_VERTICAL));
gtk_box_pack_start (GTK_BOX (flowbox_cntl), hbox);
gtk_container_add (GTK_CONTAINER (flowbox_cntl), hbox);
/* filtering and sorting */
@ -574,7 +574,7 @@ create_window (void)
gtk_widget_show (widget);
gtk_widget_set_tooltip_text (widget, "Set whether some items should be filtered out");
gtk_box_pack_start (GTK_BOX (flowbox_cntl), widget);
gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget);
g_signal_connect (G_OBJECT (widget), "toggled",
G_CALLBACK (filter_toggled), flowbox);
@ -584,7 +584,7 @@ create_window (void)
gtk_widget_show (widget);
gtk_widget_set_tooltip_text (widget, "Set whether items should be sorted");
gtk_box_pack_start (GTK_BOX (flowbox_cntl), widget);
gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget);
g_signal_connect (G_OBJECT (widget), "toggled",
G_CALLBACK (sort_toggled), flowbox);
@ -597,7 +597,7 @@ create_window (void)
gtk_widget_show (items_cntl);
gtk_widget_show (expander);
gtk_container_add (GTK_CONTAINER (expander), items_cntl);
gtk_box_pack_start (GTK_BOX (vbox), expander);
gtk_container_add (GTK_CONTAINER (vbox), expander);
/* Add Items control */
widget = gtk_combo_box_text_new ();
@ -610,7 +610,7 @@ create_window (void)
gtk_widget_show (widget);
gtk_widget_set_tooltip_text (widget, "Set the item set to use");
gtk_box_pack_start (GTK_BOX (items_cntl), widget);
gtk_container_add (GTK_CONTAINER (items_cntl), widget);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (items_changed), flowbox);

View File

@ -146,7 +146,7 @@ int main (int argc, char **argv)
frame = GTK_FRAME (gtk_frame_new ("Test GtkFrame"));
gtk_widget_set_vexpand (GTK_WIDGET (frame), TRUE);
gtk_box_pack_start (vbox, GTK_WIDGET (frame));
gtk_container_add (GTK_CONTAINER (vbox), GTK_WIDGET (frame));
widget = gtk_button_new_with_label ("Hello!");
gtk_container_add (GTK_CONTAINER (frame), widget);
@ -154,7 +154,7 @@ int main (int argc, char **argv)
grid = GTK_GRID (gtk_grid_new ());
gtk_grid_set_row_spacing (grid, 12);
gtk_grid_set_column_spacing (grid, 6);
gtk_box_pack_start (vbox, GTK_WIDGET (grid));
gtk_container_add (GTK_CONTAINER (vbox), GTK_WIDGET (grid));
xalign = gtk_frame_get_label_align (frame);

View File

@ -41,32 +41,32 @@ main (int argc,
gtk_container_add (GTK_CONTAINER (toplevel), hbox);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
gtk_box_pack_start (GTK_BOX (hbox), vbox);
gtk_container_add (GTK_CONTAINER (hbox), vbox);
image = gtk_image_new_from_gicon (G_ICON (pixbuf));
gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
gtk_box_pack_start (GTK_BOX (vbox), image);
gtk_container_add (GTK_CONTAINER (vbox), image);
label = gtk_label_new (NULL);
str = g_strdup_printf ("Normal icon, hash %u", g_icon_hash (G_ICON (pixbuf)));
gtk_label_set_label (GTK_LABEL (label), str);
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
otherpix = gdk_pixbuf_new_from_file ("gnome-textfile.png", NULL);
emblem = g_emblem_new (G_ICON (otherpix));
emblemed = g_emblemed_icon_new (G_ICON (pixbuf), emblem);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
gtk_box_pack_start (GTK_BOX (hbox), vbox);
gtk_container_add (GTK_CONTAINER (hbox), vbox);
image2 = gtk_image_new_from_gicon (emblemed);
gtk_image_set_icon_size (GTK_IMAGE (image2), GTK_ICON_SIZE_LARGE);
gtk_box_pack_start (GTK_BOX (vbox), image2);
gtk_container_add (GTK_CONTAINER (vbox), image2);
label = gtk_label_new (NULL);
str = g_strdup_printf ("Emblemed icon, hash %u", g_icon_hash (emblemed));
gtk_label_set_label (GTK_LABEL (label), str);
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
gtk_widget_show (toplevel);

View File

@ -148,21 +148,21 @@ box_comparison (void)
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_add (GTK_CONTAINER (vbox), box);
gtk_box_pack_start (GTK_BOX (box), test_widget ("1", "white"));
gtk_container_add (GTK_CONTAINER (box), test_widget ("1", "white"));
label = gtk_label_new ("Some ellipsizing text");
gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
gtk_label_set_width_chars (GTK_LABEL (label), 10);
gtk_box_pack_start (GTK_BOX (box), label);
gtk_container_add (GTK_CONTAINER (box), label);
gtk_box_pack_start (GTK_BOX (box), test_widget ("2", "green"));
gtk_container_add (GTK_CONTAINER (box), test_widget ("2", "green"));
label = gtk_label_new ("Some text that may wrap if needed");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_width_chars (GTK_LABEL (label), 10);
gtk_box_pack_start (GTK_BOX (box), label);
gtk_container_add (GTK_CONTAINER (box), label);
gtk_box_pack_start (GTK_BOX (box), test_widget ("3", "red"));
gtk_container_add (GTK_CONTAINER (box), test_widget ("3", "red"));
grid = gtk_grid_new ();
gtk_orientable_set_orientation (GTK_ORIENTABLE (grid), GTK_ORIENTATION_VERTICAL);

File diff suppressed because it is too large Load Diff

View File

@ -85,11 +85,11 @@ change_header (GtkButton *button, gpointer data)
gtk_style_context_add_class (gtk_widget_get_style_context (header), "header-bar");
g_object_set (header, "margin", 10, NULL);
label = gtk_label_new ("Label");
gtk_box_pack_start (GTK_BOX (header), label);
gtk_container_add (GTK_CONTAINER (header), label);
widget = gtk_level_bar_new ();
gtk_level_bar_set_value (GTK_LEVEL_BAR (widget), 0.4);
gtk_widget_set_hexpand (widget, TRUE);
gtk_box_pack_start (GTK_BOX (header), widget);
gtk_container_add (GTK_CONTAINER (header), widget);
}
else
{
@ -142,6 +142,12 @@ main (int argc, char *argv[])
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (window), box);
content = gtk_image_new_from_icon_name ("start-here-symbolic");
gtk_image_set_pixel_size (GTK_IMAGE (content), 512);
gtk_container_add (GTK_CONTAINER (box), content);
footer = gtk_action_bar_new ();
gtk_action_bar_set_center_widget (GTK_ACTION_BAR (footer), gtk_check_button_new_with_label ("Middle"));
button = gtk_toggle_button_new_with_label ("Custom");
@ -153,13 +159,7 @@ main (int argc, char *argv[])
button = gtk_button_new_with_label ("Fullscreen");
gtk_action_bar_pack_end (GTK_ACTION_BAR (footer), button);
g_signal_connect (button, "clicked", G_CALLBACK (toggle_fullscreen), window);
gtk_box_pack_end (GTK_BOX (box), footer);
content = gtk_image_new_from_icon_name ("start-here-symbolic");
gtk_image_set_pixel_size (GTK_IMAGE (content), 512);
gtk_box_pack_start (GTK_BOX (box), content);
gtk_container_add (GTK_CONTAINER (box), footer);
gtk_widget_show (window);
gtk_main ();

View File

@ -824,7 +824,7 @@ create_window (void)
g_signal_connect (button, "clicked",
G_CALLBACK (test_clicked), &interfaces[i]);
gtk_box_pack_start (GTK_BOX (vbox), button);
gtk_container_add (GTK_CONTAINER (vbox), button);
}
return window;

View File

@ -425,7 +425,7 @@ main (gint argc, gchar **argv)
paned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
gtk_widget_set_vexpand (paned, TRUE);
gtk_box_pack_start (GTK_BOX (vbox), paned);
gtk_container_add (GTK_CONTAINER (vbox), paned);
icon_list = gtk_icon_view_new ();
gtk_icon_view_set_selection_mode (GTK_ICON_VIEW (icon_list), GTK_SELECTION_MULTIPLE);
@ -541,43 +541,43 @@ main (gint argc, gchar **argv)
bbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_START);
gtk_box_pack_start (GTK_BOX (vbox), bbox);
gtk_container_add (GTK_CONTAINER (vbox), bbox);
button = gtk_button_new_with_label ("Add some");
g_signal_connect (button, "clicked", G_CALLBACK (add_some), icon_list);
gtk_box_pack_start (GTK_BOX (bbox), button);
gtk_container_add (GTK_CONTAINER (bbox), button);
button = gtk_button_new_with_label ("Add many");
g_signal_connect (button, "clicked", G_CALLBACK (add_many), icon_list);
gtk_box_pack_start (GTK_BOX (bbox), button);
gtk_container_add (GTK_CONTAINER (bbox), button);
button = gtk_button_new_with_label ("Add large");
g_signal_connect (button, "clicked", G_CALLBACK (add_large), icon_list);
gtk_box_pack_start (GTK_BOX (bbox), button);
gtk_container_add (GTK_CONTAINER (bbox), button);
button = gtk_button_new_with_label ("Remove selected");
g_signal_connect (button, "clicked", G_CALLBACK (foreach_selected_remove), icon_list);
gtk_box_pack_start (GTK_BOX (bbox), button);
gtk_container_add (GTK_CONTAINER (bbox), button);
button = gtk_button_new_with_label ("Swap");
g_signal_connect (button, "clicked", G_CALLBACK (swap_rows), icon_list);
gtk_box_pack_start (GTK_BOX (bbox), button);
gtk_container_add (GTK_CONTAINER (bbox), button);
bbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_START);
gtk_box_pack_start (GTK_BOX (vbox), bbox);
gtk_container_add (GTK_CONTAINER (vbox), bbox);
button = gtk_button_new_with_label ("Select all");
g_signal_connect (button, "clicked", G_CALLBACK (select_all), icon_list);
gtk_box_pack_start (GTK_BOX (bbox), button);
gtk_container_add (GTK_CONTAINER (bbox), button);
button = gtk_button_new_with_label ("Unselect all");
g_signal_connect (button, "clicked", G_CALLBACK (unselect_all), icon_list);
gtk_box_pack_start (GTK_BOX (bbox), button);
gtk_container_add (GTK_CONTAINER (bbox), button);
button = gtk_button_new_with_label ("Select nonexisting");
g_signal_connect (button, "clicked", G_CALLBACK (select_nonexisting), icon_list);
gtk_box_pack_start (GTK_BOX (bbox), button);
gtk_container_add (GTK_CONTAINER (bbox), button);
icon_list = gtk_icon_view_new ();

View File

@ -62,22 +62,22 @@ main (int argc, char **argv)
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
orientables = g_list_prepend (orientables, box);
gtk_grid_attach (GTK_GRID (grid), box, 0, 1, 1, 1);
gtk_box_pack_start (GTK_BOX (box),
gtk_container_add (GTK_CONTAINER (box),
gtk_button_new_with_label ("GtkBox 1"));
gtk_box_pack_start (GTK_BOX (box),
gtk_container_add (GTK_CONTAINER (box),
gtk_button_new_with_label ("GtkBox 2"));
gtk_box_pack_start (GTK_BOX (box),
gtk_container_add (GTK_CONTAINER (box),
gtk_button_new_with_label ("GtkBox 3"));
/* GtkButtonBox */
box = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
orientables = g_list_prepend (orientables, box);
gtk_grid_attach (GTK_GRID (grid), box, 1, 1, 1, 1);
gtk_box_pack_start (GTK_BOX (box),
gtk_container_add (GTK_CONTAINER (box),
gtk_button_new_with_label ("GtkButtonBox 1"));
gtk_box_pack_start (GTK_BOX (box),
gtk_container_add (GTK_CONTAINER (box),
gtk_button_new_with_label ("GtkButtonBox 2"));
gtk_box_pack_start (GTK_BOX (box),
gtk_container_add (GTK_CONTAINER (box),
gtk_button_new_with_label ("GtkButtonBox 3"));
/* GtkSeparator */

View File

@ -468,12 +468,12 @@ test_input_stacking (void)
"But the entry does");
gtk_widget_set_margin_top (label, 8);
gtk_widget_set_margin_bottom (label, 8);
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
entry = gtk_entry_new ();
gtk_widget_set_margin_top (entry, 8);
gtk_widget_set_margin_bottom (entry, 8);
gtk_box_pack_start (GTK_BOX (vbox), entry);
gtk_container_add (GTK_CONTAINER (vbox), entry);
gtk_container_add (GTK_CONTAINER (win), overlay);

View File

@ -108,13 +108,13 @@ main(int argc, char **argv)
NULL);
gtk_widget_set_halign (combo_box, GTK_ALIGN_START);
gtk_box_pack_start (GTK_BOX (vbox), combo_box);
gtk_container_add (GTK_CONTAINER (vbox), combo_box);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
label = gtk_label_new ("Overall Alpha:");
gtk_box_pack_start (GTK_BOX (hbox), label);
gtk_container_add (GTK_CONTAINER (hbox), label);
adjustment = gtk_adjustment_new (overall_alpha, 0, 255, 1, 10, 0);
g_signal_connect (adjustment, "value_changed",
@ -123,7 +123,7 @@ main(int argc, char **argv)
hscale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, adjustment);
gtk_scale_set_digits (GTK_SCALE (hscale), 0);
gtk_widget_set_hexpand (hscale, TRUE);
gtk_box_pack_start (GTK_BOX (hbox), hscale);
gtk_container_add (GTK_CONTAINER (hbox), hscale);
/* Compute the size without the drawing area, so we know how big to make the default size */
gtk_widget_get_preferred_size ( (vbox),
@ -131,7 +131,7 @@ main(int argc, char **argv)
darea = gtk_drawing_area_new ();
gtk_widget_set_hexpand (darea, TRUE);
gtk_box_pack_start (GTK_BOX (vbox), darea);
gtk_container_add (GTK_CONTAINER (vbox), darea);
gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (darea), draw_func, NULL, NULL);

View File

@ -130,7 +130,7 @@ int main (int argc, char *argv[])
scales = g_slist_prepend (scales, scale);
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
gtk_container_add (GTK_CONTAINER (frame), scale);
gtk_box_pack_start (GTK_BOX (box), frame);
gtk_container_add (GTK_CONTAINER (box), frame);
frame = gtk_frame_new ("With fill level");
scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 0, 100, 1);
@ -139,7 +139,7 @@ int main (int argc, char *argv[])
gtk_range_set_show_fill_level (GTK_RANGE (scale), TRUE);
gtk_range_set_fill_level (GTK_RANGE (scale), 50);
gtk_container_add (GTK_CONTAINER (frame), scale);
gtk_box_pack_start (GTK_BOX (box), frame);
gtk_container_add (GTK_CONTAINER (box), frame);
frame = gtk_frame_new ("Simple marks");
extra_scale = scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 0, 100, 1);
@ -149,7 +149,7 @@ int main (int argc, char *argv[])
gtk_scale_add_mark (GTK_SCALE (scale), marks[1], GTK_POS_BOTTOM, NULL);
gtk_scale_add_mark (GTK_SCALE (scale), marks[2], GTK_POS_BOTTOM, NULL);
gtk_container_add (GTK_CONTAINER (frame), scale);
gtk_box_pack_start (GTK_BOX (box), frame);
gtk_container_add (GTK_CONTAINER (box), frame);
frame = gtk_frame_new ("Simple marks up");
scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 0, 100, 1);
@ -159,7 +159,7 @@ int main (int argc, char *argv[])
gtk_scale_add_mark (GTK_SCALE (scale), marks[1], GTK_POS_TOP, NULL);
gtk_scale_add_mark (GTK_SCALE (scale), marks[2], GTK_POS_TOP, NULL);
gtk_container_add (GTK_CONTAINER (frame), scale);
gtk_box_pack_start (GTK_BOX (box), frame);
gtk_container_add (GTK_CONTAINER (box), frame);
frame = gtk_frame_new ("Labeled marks");
box2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
@ -171,7 +171,7 @@ int main (int argc, char *argv[])
gtk_scale_add_mark (GTK_SCALE (scale), marks[1], GTK_POS_BOTTOM, labels[1]);
gtk_scale_add_mark (GTK_SCALE (scale), marks[2], GTK_POS_BOTTOM, labels[2]);
gtk_container_add (GTK_CONTAINER (frame), scale);
gtk_box_pack_start (GTK_BOX (box), frame);
gtk_container_add (GTK_CONTAINER (box), frame);
frame = gtk_frame_new ("Some labels");
scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 0, 100, 1);
@ -181,7 +181,7 @@ int main (int argc, char *argv[])
gtk_scale_add_mark (GTK_SCALE (scale), marks[1], GTK_POS_TOP, NULL);
gtk_scale_add_mark (GTK_SCALE (scale), marks[2], GTK_POS_TOP, labels[2]);
gtk_container_add (GTK_CONTAINER (frame), scale);
gtk_box_pack_start (GTK_BOX (box), frame);
gtk_container_add (GTK_CONTAINER (box), frame);
frame = gtk_frame_new ("Above and below");
scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 0, 100, 1);
@ -192,7 +192,7 @@ int main (int argc, char *argv[])
gtk_scale_add_mark (GTK_SCALE (scale), bath_marks[2], GTK_POS_BOTTOM, bath_labels[2]);
gtk_scale_add_mark (GTK_SCALE (scale), bath_marks[3], GTK_POS_TOP, bath_labels[3]);
gtk_container_add (GTK_CONTAINER (frame), scale);
gtk_box_pack_start (GTK_BOX (box), frame);
gtk_container_add (GTK_CONTAINER (box), frame);
frame = gtk_frame_new ("Positions");
scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 0, 100, 1);
@ -203,7 +203,7 @@ int main (int argc, char *argv[])
gtk_scale_add_mark (GTK_SCALE (scale), pos_marks[2], GTK_POS_TOP, pos_labels[2]);
gtk_scale_add_mark (GTK_SCALE (scale), pos_marks[3], GTK_POS_BOTTOM, pos_labels[3]);
gtk_container_add (GTK_CONTAINER (frame), scale);
gtk_box_pack_start (GTK_BOX (box), frame);
gtk_container_add (GTK_CONTAINER (box), frame);
box2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_container_add (GTK_CONTAINER (box1), box2);

View File

@ -90,11 +90,11 @@ scrollable_policy (void)
gtk_widget_show (vbox);
gtk_widget_show (hbox);
gtk_container_add (GTK_CONTAINER (window), hbox);
gtk_box_pack_start (GTK_BOX (hbox), vbox);
gtk_container_add (GTK_CONTAINER (hbox), vbox);
frame = gtk_frame_new ("Scrolled Window");
gtk_widget_set_hexpand (frame, TRUE);
gtk_box_pack_start (GTK_BOX (hbox), frame);
gtk_container_add (GTK_CONTAINER (hbox), frame);
swindow = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swindow),
@ -128,7 +128,7 @@ scrollable_policy (void)
gtk_widget_show (cntl);
gtk_widget_show (expander);
gtk_container_add (GTK_CONTAINER (expander), cntl);
gtk_box_pack_start (GTK_BOX (vbox), expander);
gtk_container_add (GTK_CONTAINER (vbox), expander);
/* Add Horizontal policy control here */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
@ -136,7 +136,7 @@ scrollable_policy (void)
widget = gtk_label_new ("hscroll-policy");
gtk_widget_set_hexpand (widget, TRUE);
gtk_box_pack_start (GTK_BOX (hbox), widget);
gtk_container_add (GTK_CONTAINER (hbox), widget);
widget = gtk_combo_box_text_new ();
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Minimum");
@ -144,8 +144,8 @@ scrollable_policy (void)
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
gtk_widget_set_hexpand (widget, TRUE);
gtk_box_pack_start (GTK_BOX (hbox), widget);
gtk_box_pack_start (GTK_BOX (cntl), hbox);
gtk_container_add (GTK_CONTAINER (hbox), widget);
gtk_container_add (GTK_CONTAINER (cntl), hbox);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (horizontal_policy_changed), viewport);
@ -156,7 +156,7 @@ scrollable_policy (void)
widget = gtk_label_new ("vscroll-policy");
gtk_widget_set_hexpand (widget, TRUE);
gtk_box_pack_start (GTK_BOX (hbox), widget);
gtk_container_add (GTK_CONTAINER (hbox), widget);
widget = gtk_combo_box_text_new ();
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Minimum");
@ -164,8 +164,8 @@ scrollable_policy (void)
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
gtk_widget_set_hexpand (widget, TRUE);
gtk_box_pack_start (GTK_BOX (hbox), widget);
gtk_box_pack_start (GTK_BOX (cntl), hbox);
gtk_container_add (GTK_CONTAINER (hbox), widget);
gtk_container_add (GTK_CONTAINER (cntl), hbox);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (vertical_policy_changed), viewport);
@ -175,12 +175,12 @@ scrollable_policy (void)
widget = gtk_label_new ("min-content-width");
gtk_widget_set_hexpand (widget, TRUE);
gtk_box_pack_start (GTK_BOX (hbox), widget);
gtk_container_add (GTK_CONTAINER (hbox), widget);
widget = gtk_spin_button_new_with_range (100.0, 1000.0, 10.0);
gtk_widget_set_hexpand (widget, TRUE);
gtk_box_pack_start (GTK_BOX (hbox), widget);
gtk_box_pack_start (GTK_BOX (cntl), hbox);
gtk_container_add (GTK_CONTAINER (hbox), widget);
gtk_container_add (GTK_CONTAINER (cntl), hbox);
gtk_widget_show (widget);
gtk_widget_show (hbox);
@ -191,12 +191,12 @@ scrollable_policy (void)
widget = gtk_label_new ("min-content-height");
gtk_widget_set_hexpand (widget, TRUE);
gtk_box_pack_start (GTK_BOX (hbox), widget);
gtk_container_add (GTK_CONTAINER (hbox), widget);
widget = gtk_spin_button_new_with_range (100.0, 1000.0, 10.0);
gtk_widget_set_hexpand (widget, TRUE);
gtk_box_pack_start (GTK_BOX (hbox), widget);
gtk_box_pack_start (GTK_BOX (cntl), hbox);
gtk_container_add (GTK_CONTAINER (hbox), widget);
gtk_container_add (GTK_CONTAINER (cntl), hbox);
gtk_widget_show (widget);
gtk_widget_show (hbox);
@ -206,7 +206,7 @@ scrollable_policy (void)
/* Add Kinetic scrolling control here */
widget = gtk_check_button_new_with_label ("Kinetic scrolling");
gtk_widget_set_hexpand (widget, TRUE);
gtk_box_pack_start (GTK_BOX (cntl), widget);
gtk_container_add (GTK_CONTAINER (cntl), widget);
g_signal_connect (G_OBJECT (widget), "toggled",
G_CALLBACK (kinetic_scrolling_changed), swindow);
@ -218,7 +218,7 @@ scrollable_policy (void)
widget = gtk_menu_button_new ();
gtk_menu_button_set_popover (GTK_MENU_BUTTON (widget), popover);
gtk_container_add (GTK_CONTAINER (widget), gtk_label_new ("Popover"));
gtk_box_pack_start (GTK_BOX (cntl), widget);
gtk_container_add (GTK_CONTAINER (cntl), widget);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_container_add (GTK_CONTAINER (popover), vbox);
@ -228,9 +228,7 @@ scrollable_policy (void)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swindow),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_box_pack_end (GTK_BOX (vbox), swindow);
gtk_widget_show (swindow);
gtk_widget_show (hbox);
gtk_container_add (GTK_CONTAINER (vbox), swindow);
/* Listbox */
listbox = gtk_list_box_new ();
@ -242,11 +240,11 @@ scrollable_policy (void)
widget = gtk_label_new ("min-content-width");
gtk_widget_set_hexpand (widget, TRUE);
gtk_box_pack_start (GTK_BOX (hbox), widget);
gtk_container_add (GTK_CONTAINER (hbox), widget);
widget = gtk_spin_button_new_with_range (0.0, 150.0, 10.0);
gtk_widget_set_hexpand (widget, TRUE);
gtk_box_pack_start (GTK_BOX (hbox), widget);
gtk_container_add (GTK_CONTAINER (hbox), widget);
g_object_bind_property (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget)),
"value",
@ -256,13 +254,13 @@ scrollable_policy (void)
widget = gtk_label_new ("min-content-height");
gtk_widget_set_hexpand (widget, TRUE);
gtk_box_pack_start (GTK_BOX (hbox), widget);
gtk_container_add (GTK_CONTAINER (hbox), widget);
widget = gtk_spin_button_new_with_range (0.0, 150.0, 10.0);
gtk_widget_set_hexpand (widget, TRUE);
gtk_box_pack_start (GTK_BOX (hbox), widget);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (hbox), widget);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
g_object_bind_property (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget)),
"value",
@ -275,11 +273,11 @@ scrollable_policy (void)
widget = gtk_label_new ("max-content-width");
gtk_widget_set_hexpand (widget, TRUE);
gtk_box_pack_start (GTK_BOX (hbox), widget);
gtk_container_add (GTK_CONTAINER (hbox), widget);
widget = gtk_spin_button_new_with_range (250.0, 1000.0, 10.0);
gtk_widget_set_hexpand (widget, TRUE);
gtk_box_pack_start (GTK_BOX (hbox), widget);
gtk_container_add (GTK_CONTAINER (hbox), widget);
g_object_bind_property (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget)),
"value",
@ -289,12 +287,12 @@ scrollable_policy (void)
widget = gtk_label_new ("max-content-height");
gtk_widget_set_hexpand (widget, TRUE);
gtk_box_pack_start (GTK_BOX (hbox), widget);
gtk_container_add (GTK_CONTAINER (hbox), widget);
widget = gtk_spin_button_new_with_range (250.0, 1000.0, 10.0);
gtk_widget_set_hexpand (widget, TRUE);
gtk_box_pack_start (GTK_BOX (hbox), widget);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (hbox), widget);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
g_object_bind_property (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget)),
"value",
@ -307,15 +305,15 @@ scrollable_policy (void)
widget = gtk_button_new_with_label ("Remove");
gtk_widget_set_hexpand (widget, TRUE);
gtk_box_pack_start (GTK_BOX (hbox), widget);
gtk_container_add (GTK_CONTAINER (hbox), widget);
g_signal_connect (widget, "clicked",
G_CALLBACK (remove_row), listbox);
widget = gtk_button_new_with_label ("Add");
gtk_widget_set_hexpand (widget, TRUE);
gtk_box_pack_start (GTK_BOX (hbox), widget);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (hbox), widget);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
g_signal_connect (widget, "clicked",
G_CALLBACK (add_row), listbox);

View File

@ -65,15 +65,15 @@ int main (int argc, char *argv[])
gtk_container_add (GTK_CONTAINER (window), box);
w = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 15);
gtk_box_pack_start (GTK_BOX (box), w);
gtk_box_pack_start (GTK_BOX (w), gtk_entry_new ());
gtk_container_add (GTK_CONTAINER (box), w);
gtk_container_add (GTK_CONTAINER (w), gtk_entry_new ());
bu = gtk_button_new_with_label ("Bu");
gtk_box_pack_start (GTK_BOX (w), bu);
gtk_container_add (GTK_CONTAINER (w), bu);
c = gtk_switch_new ();
gtk_switch_set_active (GTK_SWITCH (c), TRUE);
gtk_widget_set_halign (c, GTK_ALIGN_CENTER);
gtk_widget_set_valign (c, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (box), c);
gtk_container_add (GTK_CONTAINER (box), c);
g_signal_connect (bu, "clicked", G_CALLBACK (set_insensitive), w);
g_signal_connect (bu, "state-flags-changed", G_CALLBACK (state_flags_changed), NULL);

View File

@ -60,7 +60,7 @@ prepare_window_for_orientation (GtkOrientation orientation)
g_object_bind_property (wrap_button, "active", spin, "wrap", G_BINDING_SYNC_CREATE);
GtkWidget *hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
gtk_box_pack_start (GTK_BOX (hbox), spin);
gtk_container_add (GTK_CONTAINER (hbox), spin);
gtk_container_add (GTK_CONTAINER (mainbox), hbox);
}

View File

@ -127,7 +127,7 @@ main (gint argc,
gtk_container_add (GTK_CONTAINER (window), box);
switcher = gtk_stack_switcher_new ();
gtk_box_pack_start (GTK_BOX (box), switcher);
gtk_container_add (GTK_CONTAINER (box), switcher);
stack = gtk_stack_new ();
@ -141,9 +141,9 @@ main (gint argc,
sidebar = gtk_stack_sidebar_new ();
gtk_stack_sidebar_set_stack (GTK_STACK_SIDEBAR (sidebar), GTK_STACK (stack));
layout = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (layout), sidebar);
gtk_container_add (GTK_CONTAINER (layout), sidebar);
gtk_widget_set_hexpand (stack, TRUE);
gtk_box_pack_start (GTK_BOX (layout), stack);
gtk_container_add (GTK_CONTAINER (layout), stack);
gtk_container_add (GTK_CONTAINER (box), layout);

View File

@ -26,12 +26,12 @@ make_switch (gboolean is_on,
sw = gtk_switch_new ();
gtk_switch_set_active (GTK_SWITCH (sw), is_on);
gtk_box_pack_start (GTK_BOX (hbox), sw);
gtk_container_add (GTK_CONTAINER (hbox), sw);
gtk_widget_set_sensitive (sw, is_sensitive);
label = gtk_label_new (is_on ? "Enabled" : "Disabled");
gtk_widget_set_hexpand (label, TRUE);
gtk_box_pack_end (GTK_BOX (hbox), label);
gtk_container_add (GTK_CONTAINER (hbox), label);
g_object_bind_property_full (sw, "active",
label, "label",
@ -116,24 +116,18 @@ make_delayed_switch (gboolean is_on,
sw = gtk_switch_new ();
gtk_switch_set_active (GTK_SWITCH (sw), is_on);
gtk_box_pack_start (GTK_BOX (hbox), sw);
gtk_container_add (GTK_CONTAINER (hbox), sw);
gtk_widget_set_sensitive (sw, is_sensitive);
g_signal_connect (sw, "state-set", G_CALLBACK (set_state), NULL);
spinner = gtk_spinner_new ();
gtk_box_pack_start (GTK_BOX (hbox), spinner);
gtk_container_add (GTK_CONTAINER (hbox), spinner);
gtk_widget_set_opacity (spinner, 0.0);
check = gtk_check_button_new ();
gtk_box_pack_end (GTK_BOX (hbox), check);
g_object_bind_property (sw, "state",
check, "active",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
label = gtk_label_new (is_on ? "Enabled" : "Disabled");
gtk_widget_set_hexpand (label, TRUE);
gtk_box_pack_end (GTK_BOX (hbox), label);
gtk_container_add (GTK_CONTAINER (hbox), label);
g_object_bind_property_full (sw, "active",
label, "label",
@ -142,6 +136,12 @@ make_delayed_switch (gboolean is_on,
NULL,
NULL, NULL);
check = gtk_check_button_new ();
gtk_container_add (GTK_CONTAINER (hbox), check);
g_object_bind_property (sw, "state",
check, "active",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
g_signal_connect (sw, "notify", G_CALLBACK (sw_delay_notify), spinner);
return hbox;

View File

@ -457,19 +457,19 @@ main (gint argc, gchar **argv)
gtk_grid_attach (GTK_GRID (grid), hbox2, 1, 2, 1, 1);
checkbox = gtk_check_button_new_with_mnemonic("_Vertical");
gtk_box_pack_start (GTK_BOX (hbox1), checkbox);
gtk_container_add (GTK_CONTAINER (hbox1), checkbox);
g_signal_connect (checkbox, "toggled",
G_CALLBACK (change_orientation), toolbar);
checkbox = gtk_check_button_new_with_mnemonic("_Show Arrow");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox), TRUE);
gtk_box_pack_start (GTK_BOX (hbox1), checkbox);
gtk_container_add (GTK_CONTAINER (hbox1), checkbox);
g_signal_connect (checkbox, "toggled",
G_CALLBACK (change_show_arrow), toolbar);
checkbox = gtk_check_button_new_with_mnemonic("_Set Toolbar Style:");
g_signal_connect (checkbox, "toggled", G_CALLBACK (set_toolbar_style_toggled), toolbar);
gtk_box_pack_start (GTK_BOX (hbox1), checkbox);
gtk_container_add (GTK_CONTAINER (hbox1), checkbox);
option_menu = gtk_combo_box_text_new ();
gtk_widget_set_sensitive (option_menu, FALSE);
@ -479,7 +479,7 @@ main (gint argc, gchar **argv)
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (option_menu), toolbar_styles[i]);
gtk_combo_box_set_active (GTK_COMBO_BOX (option_menu),
gtk_toolbar_get_style (GTK_TOOLBAR (toolbar)));
gtk_box_pack_start (GTK_BOX (hbox2), option_menu);
gtk_container_add (GTK_CONTAINER (hbox2), option_menu);
g_signal_connect (option_menu, "changed",
G_CALLBACK (change_toolbar_style), toolbar);
@ -630,13 +630,16 @@ main (gint argc, gchar **argv)
gtk_grid_attach (GTK_GRID (grid), hbox, 1, 4, 1, 1);
button = gtk_button_new_with_label ("Drag me to the toolbar");
gtk_box_pack_start (GTK_BOX (hbox), button);
gtk_container_add (GTK_CONTAINER (hbox), button);
label = gtk_label_new ("Drop index:");
gtk_box_pack_start (GTK_BOX (hbox), label);
gtk_container_add (GTK_CONTAINER (hbox), label);
label = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (hbox), label);
gtk_widget_set_hexpand (label, TRUE);
gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_container_add (GTK_CONTAINER (hbox), label);
checkbox = gtk_check_button_new_with_mnemonic("_Right to left");
if (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL)
@ -645,7 +648,7 @@ main (gint argc, gchar **argv)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox), FALSE);
g_signal_connect (checkbox, "toggled", G_CALLBACK (rtl_toggled), NULL);
gtk_box_pack_end (GTK_BOX (hbox), checkbox);
gtk_container_add (GTK_CONTAINER (hbox), checkbox);
targets = gdk_content_formats_new (target_table, G_N_ELEMENTS (target_table));
gtk_drag_source_set (button, GDK_BUTTON1_MASK,

View File

@ -313,7 +313,7 @@ main (int argc, char *argv[])
/* A check button using the tooltip-markup property */
button = gtk_check_button_new_with_label ("This one uses the tooltip-markup property");
gtk_widget_set_tooltip_text (button, "Hello, I am a static tooltip.");
gtk_box_pack_start (GTK_BOX (box), button);
gtk_container_add (GTK_CONTAINER (box), button);
text = gtk_widget_get_tooltip_text (button);
markup = gtk_widget_get_tooltip_markup (button);
@ -326,13 +326,13 @@ main (int argc, char *argv[])
g_object_set (button, "has-tooltip", TRUE, NULL);
g_signal_connect (button, "query-tooltip",
G_CALLBACK (query_tooltip_cb), NULL);
gtk_box_pack_start (GTK_BOX (box), button);
gtk_container_add (GTK_CONTAINER (box), button);
/* A label */
button = gtk_label_new ("I am just a label");
gtk_label_set_selectable (GTK_LABEL (button), FALSE);
gtk_widget_set_tooltip_text (button, "Label & and tooltip");
gtk_box_pack_start (GTK_BOX (box), button);
gtk_container_add (GTK_CONTAINER (box), button);
text = gtk_widget_get_tooltip_text (button);
markup = gtk_widget_get_tooltip_markup (button);
@ -344,7 +344,7 @@ main (int argc, char *argv[])
button = gtk_label_new ("I am a selectable label");
gtk_label_set_selectable (GTK_LABEL (button), TRUE);
gtk_widget_set_tooltip_markup (button, "<b>Another</b> Label tooltip");
gtk_box_pack_start (GTK_BOX (box), button);
gtk_container_add (GTK_CONTAINER (box), button);
text = gtk_widget_get_tooltip_text (button);
markup = gtk_widget_get_tooltip_markup (button);
@ -354,7 +354,7 @@ main (int argc, char *argv[])
/* Another one, with a custom tooltip window */
button = gtk_check_button_new_with_label ("This one has a custom tooltip window!");
gtk_box_pack_start (GTK_BOX (box), button);
gtk_container_add (GTK_CONTAINER (box), button);
tooltip_window = gtk_window_new (GTK_WINDOW_POPUP);
tooltip_button = gtk_label_new ("blaat!");
@ -375,7 +375,7 @@ main (int argc, char *argv[])
button = gtk_button_new_with_label ("This one is insensitive");
gtk_widget_set_sensitive (button, FALSE);
g_object_set (button, "tooltip-text", "Insensitive!", NULL);
gtk_box_pack_start (GTK_BOX (box), button);
gtk_container_add (GTK_CONTAINER (box), button);
/* Testcases from Kris without a tree view don't exist. */
tree_view = gtk_tree_view_new_with_model (create_model ());
@ -398,7 +398,7 @@ main (int argc, char *argv[])
gtk_tree_view_column_set_clickable (column, TRUE);
g_object_set (gtk_tree_view_column_get_button (column), "tooltip-text", "Header", NULL);
gtk_box_pack_start (GTK_BOX (box), tree_view);
gtk_container_add (GTK_CONTAINER (box), tree_view);
/* And a text view for Matthias */
buffer = gtk_text_buffer_new (NULL);
@ -422,7 +422,7 @@ main (int argc, char *argv[])
g_signal_connect (text_view, "query-tooltip",
G_CALLBACK (query_tooltip_text_view_cb), tag);
gtk_box_pack_start (GTK_BOX (box), text_view);
gtk_container_add (GTK_CONTAINER (box), text_view);
/* Drawing area */
drawing_area = gtk_drawing_area_new ();
@ -433,7 +433,7 @@ main (int argc, char *argv[])
g_object_set (drawing_area, "has-tooltip", TRUE, NULL);
g_signal_connect (drawing_area, "query-tooltip",
G_CALLBACK (query_tooltip_drawing_area_cb), NULL);
gtk_box_pack_start (GTK_BOX (box), drawing_area);
gtk_container_add (GTK_CONTAINER (box), drawing_area);
button = gtk_label_new ("Custom tooltip I");
label = gtk_label_new ("See, custom");
@ -441,13 +441,13 @@ main (int argc, char *argv[])
g_object_set (button, "has-tooltip", TRUE, NULL);
g_signal_connect (button, "query-tooltip",
G_CALLBACK (query_tooltip_label_cb), label);
gtk_box_pack_start (GTK_BOX (box), button);
gtk_container_add (GTK_CONTAINER (box), button);
button = gtk_label_new ("Custom tooltip II");
label = gtk_label_new ("See, custom, too");
g_object_ref_sink (label);
g_object_set (button, "has-tooltip", TRUE, NULL);
gtk_box_pack_start (GTK_BOX (box), button);
gtk_container_add (GTK_CONTAINER (box), button);
g_signal_connect (button, "query-tooltip",
G_CALLBACK (query_tooltip_label_cb), label);

View File

@ -769,7 +769,7 @@ main (int argc, char *argv[])
gtk_container_add (GTK_CONTAINER (window), vbox);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
/* Left Pane */
cell = gtk_cell_renderer_text_new ();
@ -786,52 +786,52 @@ main (int argc, char *argv[])
gtk_tree_view_append_column (GTK_TREE_VIEW (left_tree_view), column);
gtk_tree_view_column_set_cell_data_func (column, cell, get_visible, NULL, NULL);
gtk_box_pack_start (GTK_BOX (hbox), swindow);
gtk_container_add (GTK_CONTAINER (hbox), swindow);
/* Middle Pane */
vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
gtk_box_pack_start (GTK_BOX (hbox), vbox2);
gtk_container_add (GTK_CONTAINER (hbox), vbox2);
bbox = gtk_button_box_new (GTK_ORIENTATION_VERTICAL);
gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_SPREAD);
gtk_box_pack_start (GTK_BOX (vbox2), bbox);
gtk_container_add (GTK_CONTAINER (vbox2), bbox);
button = gtk_button_new_with_mnemonic ("<< (_Q)");
gtk_widget_set_sensitive (button, FALSE);
g_signal_connect (button, "clicked", G_CALLBACK (add_left_clicked), top_right_tree_view);
g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (top_right_tree_view)),
"changed", G_CALLBACK (selection_changed), button);
gtk_box_pack_start (GTK_BOX (bbox), button);
gtk_container_add (GTK_CONTAINER (bbox), button);
button = gtk_button_new_with_mnemonic (">> (_W)");
gtk_widget_set_sensitive (button, FALSE);
g_signal_connect (button, "clicked", G_CALLBACK (add_right_clicked), top_right_tree_view);
g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (left_tree_view)),
"changed", G_CALLBACK (selection_changed), button);
gtk_box_pack_start (GTK_BOX (bbox), button);
gtk_container_add (GTK_CONTAINER (bbox), button);
bbox = gtk_button_box_new (GTK_ORIENTATION_VERTICAL);
gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_SPREAD);
gtk_box_pack_start (GTK_BOX (vbox2), bbox);
gtk_container_add (GTK_CONTAINER (vbox2), bbox);
button = gtk_button_new_with_mnemonic ("<< (_E)");
gtk_widget_set_sensitive (button, FALSE);
g_signal_connect (button, "clicked", G_CALLBACK (add_left_clicked), bottom_right_tree_view);
g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (bottom_right_tree_view)),
"changed", G_CALLBACK (selection_changed), button);
gtk_box_pack_start (GTK_BOX (bbox), button);
gtk_container_add (GTK_CONTAINER (bbox), button);
button = gtk_button_new_with_mnemonic (">> (_R)");
gtk_widget_set_sensitive (button, FALSE);
g_signal_connect (button, "clicked", G_CALLBACK (add_right_clicked), bottom_right_tree_view);
g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (left_tree_view)),
"changed", G_CALLBACK (selection_changed), button);
gtk_box_pack_start (GTK_BOX (bbox), button);
gtk_container_add (GTK_CONTAINER (bbox), button);
/* Right Pane */
vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
gtk_box_pack_start (GTK_BOX (hbox), vbox2);
gtk_container_add (GTK_CONTAINER (hbox), vbox2);
swindow = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
@ -846,7 +846,7 @@ main (int argc, char *argv[])
gtk_tree_view_append_column (GTK_TREE_VIEW (top_right_tree_view), column);
gtk_container_add (GTK_CONTAINER (swindow), top_right_tree_view);
gtk_box_pack_start (GTK_BOX (vbox2), swindow);
gtk_container_add (GTK_CONTAINER (vbox2), swindow);
swindow = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
@ -860,7 +860,7 @@ main (int argc, char *argv[])
gtk_tree_view_column_set_cell_data_func (column, cell, get_visible, NULL, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (bottom_right_tree_view), column);
gtk_container_add (GTK_CONTAINER (swindow), bottom_right_tree_view);
gtk_box_pack_start (GTK_BOX (vbox2), swindow);
gtk_container_add (GTK_CONTAINER (vbox2), swindow);
/* Drag and Drop */
@ -890,13 +890,13 @@ main (int argc, char *argv[])
GDK_ACTION_MOVE);
gdk_content_formats_unref (targets);
gtk_box_pack_start (GTK_BOX (vbox), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL));
gtk_container_add (GTK_CONTAINER (vbox), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL));
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
button = gtk_button_new_with_mnemonic ("_Add new Column");
g_signal_connect (button, "clicked", G_CALLBACK (add_clicked), left_tree_model);
gtk_box_pack_start (GTK_BOX (hbox), button);
gtk_container_add (GTK_CONTAINER (hbox), button);
gtk_widget_show (window);
gtk_main ();

View File

@ -190,7 +190,7 @@ main (int argc, char **argv)
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), BORDER_EXPAND);
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), ALL_EXPAND);
gtk_box_pack_start (GTK_BOX (vbox), combo_box);
gtk_container_add (GTK_CONTAINER (vbox), combo_box);
/* Scrolled window and tree view */
sw = gtk_scrolled_window_new (NULL, NULL);
@ -198,7 +198,7 @@ main (int argc, char **argv)
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_widget_set_vexpand (sw, TRUE);
gtk_box_pack_start (GTK_BOX (vbox), sw);
gtk_container_add (GTK_CONTAINER (vbox), sw);
tree_view = gtk_tree_view_new_with_model (create_model ());
gtk_container_add (GTK_CONTAINER (sw), tree_view);
@ -221,7 +221,7 @@ main (int argc, char **argv)
button = gtk_toggle_button_new_with_label ("Toggle long content row");
g_signal_connect (button, "toggled",
G_CALLBACK (toggle_long_content_row), tree_view);
gtk_box_pack_start (GTK_BOX (vbox), button);
gtk_container_add (GTK_CONTAINER (vbox), button);
/* Set up option menu callback and default item */
g_signal_connect (combo_box, "changed",

View File

@ -208,7 +208,7 @@ create_control (GtkWidget *box, gint number, gint cntl, CallbackData *data)
checkbutton = gtk_check_button_new_with_label (name);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), cntl == CNTL_FIXED);
gtk_box_pack_start (GTK_BOX (box), checkbutton);
gtk_container_add (GTK_CONTAINER (box), checkbutton);
g_signal_connect (G_OBJECT (checkbutton), "toggled", callback, data);
g_free (name);
@ -245,7 +245,7 @@ main (gint argc, gchar **argv)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_widget_set_vexpand (scrolled_window, TRUE);
gtk_box_pack_start (GTK_BOX (vbox), scrolled_window);
gtk_container_add (GTK_CONTAINER (vbox), scrolled_window);
tree_model = create_model ();
tree_view = gtk_tree_view_new_with_model (tree_model);
@ -350,11 +350,11 @@ main (gint argc, gchar **argv)
800, 250);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
/* Alignment controls */
cntl_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
gtk_box_pack_start (GTK_BOX (hbox), cntl_vbox);
gtk_container_add (GTK_CONTAINER (hbox), cntl_vbox);
create_control (cntl_vbox, 1, CNTL_ALIGN, &callback[0]);
create_control (cntl_vbox, 2, CNTL_ALIGN, &callback[1]);
@ -363,7 +363,7 @@ main (gint argc, gchar **argv)
/* Expand controls */
cntl_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
gtk_box_pack_start (GTK_BOX (hbox), cntl_vbox);
gtk_container_add (GTK_CONTAINER (hbox), cntl_vbox);
create_control (cntl_vbox, 1, CNTL_EXPAND, &callback[0]);
create_control (cntl_vbox, 2, CNTL_EXPAND, &callback[1]);
@ -372,7 +372,7 @@ main (gint argc, gchar **argv)
/* Fixed controls */
cntl_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
gtk_box_pack_start (GTK_BOX (hbox), cntl_vbox);
gtk_container_add (GTK_CONTAINER (hbox), cntl_vbox);
create_control (cntl_vbox, 1, CNTL_FIXED, &callback[0]);
create_control (cntl_vbox, 2, CNTL_FIXED, &callback[1]);

View File

@ -134,14 +134,14 @@ main (int argc, char *argv[])
gtk_window_set_title (GTK_WINDOW (window), "Reflow test");
g_signal_connect (window, "destroy", gtk_main_quit, NULL);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new ("Incremental Reflow Test"));
gtk_container_add (GTK_CONTAINER (vbox), gtk_label_new ("Incremental Reflow Test"));
gtk_container_add (GTK_CONTAINER (window), vbox);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_widget_set_vexpand (scrolled_window, TRUE);
gtk_box_pack_start (GTK_BOX (vbox), scrolled_window);
gtk_container_add (GTK_CONTAINER (vbox), scrolled_window);
initialize_model ();
tree_view = gtk_tree_view_new_with_model (model);
@ -157,9 +157,9 @@ main (int argc, char *argv[])
NULL);
gtk_container_add (GTK_CONTAINER (scrolled_window), tree_view);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
button = gtk_button_new_with_mnemonic ("<b>_Futz!!</b>");
gtk_box_pack_start (GTK_BOX (hbox), button);
gtk_container_add (GTK_CONTAINER (hbox), button);
gtk_label_set_use_markup (GTK_LABEL (gtk_bin_get_child (GTK_BIN (button))), TRUE);
g_signal_connect (button, "clicked", G_CALLBACK (futz), NULL);
g_signal_connect (button, "realize", G_CALLBACK (gtk_widget_grab_focus), NULL);

View File

@ -352,14 +352,14 @@ main (int argc, char *argv[])
gtk_window_set_title (GTK_WINDOW (window), "Card planning sheet");
g_signal_connect (window, "destroy", gtk_main_quit, NULL);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new ("Jonathan's Holiday Card Planning Sheet"));
gtk_container_add (GTK_CONTAINER (vbox), gtk_label_new ("Jonathan's Holiday Card Planning Sheet"));
gtk_container_add (GTK_CONTAINER (window), vbox);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_ETCHED_IN);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_widget_set_vexpand (scrolled_window, TRUE);
gtk_box_pack_start (GTK_BOX (vbox), scrolled_window);
gtk_container_add (GTK_CONTAINER (vbox), scrolled_window);
model = make_model ();
tree_view = gtk_tree_view_new_with_model (model);
@ -467,14 +467,14 @@ main (int argc, char *argv[])
gtk_window_set_title (GTK_WINDOW (window), "Model");
g_signal_connect (window, "destroy", gtk_main_quit, NULL);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new ("The model revealed"));
gtk_container_add (GTK_CONTAINER (vbox), gtk_label_new ("The model revealed"));
gtk_container_add (GTK_CONTAINER (window), vbox);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_ETCHED_IN);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_widget_set_vexpand (scrolled_window, TRUE);
gtk_box_pack_start (GTK_BOX (vbox), scrolled_window);
gtk_container_add (GTK_CONTAINER (vbox), scrolled_window);
tree_view = gtk_tree_view_new_with_model (model);

View File

@ -122,20 +122,20 @@ main (int argc, char *argv[])
gtk_window_set_title (GTK_WINDOW (window), "Words, words, words - Window 1");
g_signal_connect (window, "destroy", gtk_main_quit, NULL);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new ("Jonathan and Kristian's list of cool words. (And Anders' cool list of numbers) \n\nThis is just a GtkTreeStore"));
gtk_container_add (GTK_CONTAINER (vbox), gtk_label_new ("Jonathan and Kristian's list of cool words. (And Anders' cool list of numbers) \n\nThis is just a GtkTreeStore"));
gtk_container_add (GTK_CONTAINER (window), vbox);
entry = gtk_entry_new ();
gtk_box_pack_start (GTK_BOX (vbox), entry);
gtk_container_add (GTK_CONTAINER (vbox), entry);
button = gtk_button_new_with_label ("Switch search method");
gtk_box_pack_start (GTK_BOX (vbox), button);
gtk_container_add (GTK_CONTAINER (vbox), button);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_ETCHED_IN);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_widget_set_vexpand (scrolled_window, TRUE);
gtk_box_pack_start (GTK_BOX (vbox), scrolled_window);
gtk_container_add (GTK_CONTAINER (vbox), scrolled_window);
model = gtk_tree_store_new (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT);
@ -250,7 +250,7 @@ main (int argc, char *argv[])
"Words, words, words - window 2");
g_signal_connect (window2, "destroy", gtk_main_quit, NULL);
vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
gtk_box_pack_start (GTK_BOX (vbox2),
gtk_container_add (GTK_CONTAINER (vbox2),
gtk_label_new ("Jonathan and Kristian's list of words.\n\nA GtkTreeModelSort wrapping the GtkTreeStore of window 1"));
gtk_container_add (GTK_CONTAINER (window2), vbox2);
@ -261,7 +261,7 @@ main (int argc, char *argv[])
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_widget_set_vexpand (scrolled_window2, TRUE);
gtk_box_pack_start (GTK_BOX (vbox2), scrolled_window2);
gtk_container_add (GTK_CONTAINER (vbox2), scrolled_window2);
tree_view2 = gtk_tree_view_new_with_model (smodel);
@ -319,7 +319,7 @@ main (int argc, char *argv[])
"Words, words, words - Window 3");
g_signal_connect (window3, "destroy", gtk_main_quit, NULL);
vbox3 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
gtk_box_pack_start (GTK_BOX (vbox3),
gtk_container_add (GTK_CONTAINER (vbox3),
gtk_label_new ("Jonathan and Kristian's list of words.\n\nA GtkTreeModelSort wrapping the GtkTreeModelSort of window 2"));
gtk_container_add (GTK_CONTAINER (window3), vbox3);
@ -330,7 +330,7 @@ main (int argc, char *argv[])
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_widget_set_vexpand (scrolled_window3, TRUE);
gtk_box_pack_start (GTK_BOX (vbox3), scrolled_window3);
gtk_container_add (GTK_CONTAINER (vbox3), scrolled_window3);
tree_view3 = gtk_tree_view_new_with_model (ssmodel);

View File

@ -56,7 +56,7 @@ show_dialog (void)
gtk_window_set_resizable (GTK_WINDOW (dialog), resizable);
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
label);
gtk_widget_show (label);

View File

@ -329,7 +329,7 @@ make_window (gint view_type)
/* Put them together */
gtk_container_add (GTK_CONTAINER (scrolled_window), tree_view);
gtk_widget_set_vexpand (scrolled_window, TRUE);
gtk_box_pack_start (GTK_BOX (vbox), scrolled_window);
gtk_container_add (GTK_CONTAINER (vbox), scrolled_window);
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_AUTOMATIC,
@ -338,7 +338,7 @@ make_window (gint view_type)
/* buttons */
button = gtk_button_new_with_label ("gtk_tree_store_remove");
gtk_box_pack_start (GTK_BOX (vbox), button);
gtk_container_add (GTK_CONTAINER (vbox), button);
g_signal_connect (selection, "changed",
G_CALLBACK (selection_changed),
button);
@ -350,9 +350,9 @@ make_window (gint view_type)
button = gtk_button_new_with_label ("gtk_tree_store_insert");
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
entry = gtk_entry_new ();
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_box_pack_start (GTK_BOX (hbox), button);
gtk_box_pack_start (GTK_BOX (hbox), entry);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
gtk_container_add (GTK_CONTAINER (hbox), button);
gtk_container_add (GTK_CONTAINER (hbox), entry);
g_object_set_data (G_OBJECT (button), "user_data", entry);
g_signal_connect (button, "clicked",
G_CALLBACK (iter_insert),
@ -361,9 +361,9 @@ make_window (gint view_type)
button = gtk_button_new_with_label ("gtk_tree_store_set");
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
entry = gtk_entry_new ();
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_box_pack_start (GTK_BOX (hbox), button);
gtk_box_pack_start (GTK_BOX (hbox), entry);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
gtk_container_add (GTK_CONTAINER (hbox), button);
gtk_container_add (GTK_CONTAINER (hbox), entry);
g_object_set_data (G_OBJECT (button), "user_data", entry);
g_signal_connect (button, "clicked",
G_CALLBACK (iter_change),
@ -372,16 +372,16 @@ make_window (gint view_type)
button = gtk_button_new_with_label ("gtk_tree_store_insert_with_values");
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
entry = gtk_entry_new ();
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_box_pack_start (GTK_BOX (hbox), button);
gtk_box_pack_start (GTK_BOX (hbox), entry);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
gtk_container_add (GTK_CONTAINER (hbox), button);
gtk_container_add (GTK_CONTAINER (hbox), entry);
g_object_set_data (G_OBJECT (button), "user_data", entry);
g_signal_connect (button, "clicked",
G_CALLBACK (iter_insert_with_values),
tree_view);
button = gtk_button_new_with_label ("gtk_tree_store_insert_before");
gtk_box_pack_start (GTK_BOX (vbox), button);
gtk_container_add (GTK_CONTAINER (vbox), button);
g_signal_connect (button, "clicked",
G_CALLBACK (iter_insert_before),
tree_view);
@ -391,7 +391,7 @@ make_window (gint view_type)
gtk_widget_set_sensitive (button, FALSE);
button = gtk_button_new_with_label ("gtk_tree_store_insert_after");
gtk_box_pack_start (GTK_BOX (vbox), button);
gtk_container_add (GTK_CONTAINER (vbox), button);
g_signal_connect (button, "clicked",
G_CALLBACK (iter_insert_after),
tree_view);
@ -401,13 +401,13 @@ make_window (gint view_type)
gtk_widget_set_sensitive (button, FALSE);
button = gtk_button_new_with_label ("gtk_tree_store_prepend");
gtk_box_pack_start (GTK_BOX (vbox), button);
gtk_container_add (GTK_CONTAINER (vbox), button);
g_signal_connect (button, "clicked",
G_CALLBACK (iter_prepend),
tree_view);
button = gtk_button_new_with_label ("gtk_tree_store_append");
gtk_box_pack_start (GTK_BOX (vbox), button);
gtk_container_add (GTK_CONTAINER (vbox), button);
g_signal_connect (button, "clicked",
G_CALLBACK (iter_append),
tree_view);