Compare commits

...

22 Commits

Author SHA1 Message Date
Matthias Clasen c2c5273319 Document the new api 2019-01-22 23:19:24 -05:00
Matthias Clasen 88a4ee1352 Redo in terms of reorder_after / insert_after
Change the reorder api to insert after the sibling,
so that moving to first place becomes reorder (... NULL).
And add a insert_after api that can replace the common
container_add / reorder_after (... NULL) combination.

Update all callers.
2019-01-22 23:08:26 -05:00
Matthias Clasen 1ea403caf0 Redo using reorder_child
Replace new insertion api with a sibling-based
reorder_child. Update all callers.
2019-01-22 22:15:50 -05:00
Matthias Clasen 9c4cccf0fa action bar: Drop the position child property
There is no particular need to have this, and we want
to get rid of child properties.
2019-01-22 20:10:06 -05:00
Matthias Clasen 2132dfce57 box: Remove gtk_box_reorder_child
This function is defined in terms of child positions,
and we've dropped the position child property, so this
function does not fit well anymore.

Update all callers to do things differently.
2019-01-22 20:06:02 -05:00
Matthias Clasen 17a3aad10b box: Add insertion apis
Add prepend/append/insert_before/insert_after, which are
all just simple wrappers around GtkWidget api.
2019-01-22 18:50:02 -05:00
Matthias Clasen 522f95ffd4 box: Remove the position child property
The position child property is problematic, since it
requires us to emit notification for all children when
inserting a child early in the list of children.

Remove the property from all ui files.
2019-01-22 18:31:01 -05:00
Timm Bäder 49765c38a5 migration guide: Add a paragraph about GtkBox's pack-type 2019-01-03 09:02:57 +01:00
Timm Bäder a8c7aa0896 box: Remove gtk_box_pack_start 2019-01-03 09:02:57 +01:00
Timm Bäder 4d9dfce60b box: Remove gtk_box_pack_end 2019-01-03 09:02:57 +01:00
Timm Bäder 355bb107ed box: Simplify documentation
Remove all references to any sort of "packing".
2019-01-03 09:02:57 +01:00
Timm Bäder e9b450cda8 box: Remove children list
GtkWidget saves a widget list for us, so we don't need to keep track of
them ourselves. This is okay now that we don't have a pack-type child
property anymore.
2019-01-03 09:02:57 +01:00
Timm Bäder 44f9e77a1c testsuite: Remove box packing css node tests
Testing the correct css order for mixed pack-start/pack-end cases
doesn't make sense if boxes don't have a notion of pack-type anymore.
2019-01-03 09:02:57 +01:00
Timm Bäder 8172327350 box: Remove pack-type child property 2019-01-03 09:02:57 +01:00
Timm Bäder 048bff9c0b assistant: Fix button order in ui file 2019-01-03 09:02:57 +01:00
Timm Bäder d89e355b0c dialog: Expose the content area as a separate GtkBox child
This way, the "vbox" internal child does not contain anything by
default. It previously did contain "internal" widgetry like the action
area.
2019-01-03 09:02:57 +01:00
Timm Bäder a916e81fdd Stop using GtkBox's pack-type child prop in UI files 2019-01-03 09:02:57 +01:00
Timm Bäder c8211c6354 combobox: Stop using GtkBox's pack-type property
Reorder the child widgets accordingly instead.
2019-01-03 09:02:57 +01:00
Timm Bäder 7fdd26210a scalebutton: Stop relying on GtkBox's pack-type child prop 2019-01-03 09:02:57 +01:00
Timm Bäder 8588481407 Stop using gtk_box_pack_end
It might soon go away!
2019-01-03 09:02:57 +01:00
Timm Bäder f996adac72 tests: Remove flicker test
gtk+ hasn't been flickering in ages so this test isn't very useful.
2019-01-03 09:02:57 +01:00
Timm Bäder 051cbacb9e shortcutssection: Use a center box as footer 2019-01-03 09:02:57 +01:00
212 changed files with 1425 additions and 4020 deletions
+3 -3
View File
@@ -96,12 +96,12 @@ create_page1 (GtkWidget *assistant)
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
label = gtk_label_new ("You must fill out this entry to continue:");
gtk_box_pack_start (GTK_BOX (box), label);
gtk_container_add (GTK_CONTAINER (box), label);
entry = gtk_entry_new ();
gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
gtk_widget_set_valign (entry, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (box), entry);
gtk_container_add (GTK_CONTAINER (box), entry);
g_signal_connect (G_OBJECT (entry), "changed",
G_CALLBACK (on_entry_changed), assistant);
@@ -119,7 +119,7 @@ create_page2 (GtkWidget *assistant)
checkbutton = gtk_check_button_new_with_label ("This is optional data, you may continue "
"even if you do not check this");
gtk_box_pack_start (GTK_BOX (box), checkbutton);
gtk_container_add (GTK_CONTAINER (box), checkbutton);
gtk_assistant_append_page (GTK_ASSISTANT (assistant), box);
gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), box, TRUE);
+14 -14
View File
@@ -70,51 +70,51 @@ do_button_box (GtkWidget *do_widget)
frame_horz = gtk_frame_new ("Horizontal Button Boxes");
gtk_widget_set_margin_top (frame_horz, 10);
gtk_widget_set_margin_bottom (frame_horz, 10);
gtk_box_pack_start (GTK_BOX (main_vbox), frame_horz);
gtk_container_add (GTK_CONTAINER (main_vbox), frame_horz);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
g_object_set (vbox, "margin", 10, NULL);
gtk_container_add (GTK_CONTAINER (frame_horz), vbox);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox),
create_bbox (TRUE, "Spread", 40, GTK_BUTTONBOX_SPREAD));
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox),
create_bbox (TRUE, "Edge", 40, GTK_BUTTONBOX_EDGE));
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox),
create_bbox (TRUE, "Start", 40, GTK_BUTTONBOX_START));
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox),
create_bbox (TRUE, "End", 40, GTK_BUTTONBOX_END));
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox),
create_bbox (TRUE, "Center", 40, GTK_BUTTONBOX_CENTER));
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox),
create_bbox (TRUE, "Expand", 0, GTK_BUTTONBOX_EXPAND));
frame_vert = gtk_frame_new ("Vertical Button Boxes");
gtk_box_pack_start (GTK_BOX (main_vbox), frame_vert);
gtk_container_add (GTK_CONTAINER (main_vbox), frame_vert);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
g_object_set (hbox, "margin", 10, NULL);
gtk_container_add (GTK_CONTAINER (frame_vert), hbox);
gtk_box_pack_start (GTK_BOX (hbox),
gtk_container_add (GTK_CONTAINER (hbox),
create_bbox (FALSE, "Spread", 10, GTK_BUTTONBOX_SPREAD));
gtk_box_pack_start (GTK_BOX (hbox),
gtk_container_add (GTK_CONTAINER (hbox),
create_bbox (FALSE, "Edge", 10, GTK_BUTTONBOX_EDGE));
gtk_box_pack_start (GTK_BOX (hbox),
gtk_container_add (GTK_CONTAINER (hbox),
create_bbox (FALSE, "Start", 10, GTK_BUTTONBOX_START));
gtk_box_pack_start (GTK_BOX (hbox),
gtk_container_add (GTK_CONTAINER (hbox),
create_bbox (FALSE, "End", 10, GTK_BUTTONBOX_END));
gtk_box_pack_start (GTK_BOX (hbox),
gtk_container_add (GTK_CONTAINER (hbox),
create_bbox (FALSE, "Center", 10, GTK_BUTTONBOX_CENTER));
gtk_box_pack_start (GTK_BOX (hbox),
gtk_container_add (GTK_CONTAINER (hbox),
create_bbox (FALSE, "Expand", 0, GTK_BUTTONBOX_EXPAND));
}
+6 -6
View File
@@ -315,7 +315,7 @@ create_frame (ChangeDisplayInfo *info,
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrollwin),
GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (hbox), scrollwin);
gtk_container_add (GTK_CONTAINER (hbox), scrollwin);
*tree_view = gtk_tree_view_new ();
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (*tree_view), FALSE);
@@ -325,7 +325,7 @@ create_frame (ChangeDisplayInfo *info,
gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
*button_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
gtk_box_pack_start (GTK_BOX (hbox), *button_vbox);
gtk_container_add (GTK_CONTAINER (hbox), *button_vbox);
if (!info->size_group)
info->size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
@@ -365,11 +365,11 @@ create_display_frame (ChangeDisplayInfo *info)
button = left_align_button_new ("_Open...");
g_signal_connect (button, "clicked", G_CALLBACK (open_display_cb), info);
gtk_box_pack_start (GTK_BOX (button_vbox), button);
gtk_container_add (GTK_CONTAINER (button_vbox), button);
button = left_align_button_new ("_Close");
g_signal_connect (button, "clicked", G_CALLBACK (close_display_cb), info);
gtk_box_pack_start (GTK_BOX (button_vbox), button);
gtk_container_add (GTK_CONTAINER (button_vbox), button);
info->display_model = (GtkTreeModel *)gtk_list_store_new (DISPLAY_NUM_COLUMNS,
G_TYPE_STRING,
@@ -542,10 +542,10 @@ do_changedisplay (GtkWidget *do_widget)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
g_object_set (vbox, "margin", 8, NULL);
gtk_box_pack_start (GTK_BOX (content_area), vbox);
gtk_container_add (GTK_CONTAINER (content_area), vbox);
frame = create_display_frame (info);
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
initialize_displays (info);
+10 -10
View File
@@ -259,45 +259,45 @@ do_clipboard (GtkWidget *do_widget)
label = gtk_label_new ("\"Copy\" will copy the text\nin the entry to the clipboard");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
g_object_set (hbox, "margin", 8, NULL);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
/* Create the first entry */
entry = gtk_entry_new ();
gtk_box_pack_start (GTK_BOX (hbox), entry);
gtk_container_add (GTK_CONTAINER (hbox), entry);
/* Create the button */
button = gtk_button_new_with_mnemonic (_("_Copy"));
gtk_box_pack_start (GTK_BOX (hbox), button);
gtk_container_add (GTK_CONTAINER (hbox), button);
g_signal_connect (button, "clicked",
G_CALLBACK (copy_button_clicked), entry);
label = gtk_label_new ("\"Paste\" will paste the text from the clipboard to the entry");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
g_object_set (hbox, "margin", 8, NULL);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
/* Create the second entry */
entry = gtk_entry_new ();
gtk_box_pack_start (GTK_BOX (hbox), entry);
gtk_container_add (GTK_CONTAINER (hbox), entry);
/* Create the button */
button = gtk_button_new_with_mnemonic (_("_Paste"));
gtk_box_pack_start (GTK_BOX (hbox), button);
gtk_container_add (GTK_CONTAINER (hbox), button);
g_signal_connect (button, "clicked",
G_CALLBACK (paste_button_clicked), entry);
label = gtk_label_new ("Images can be transferred via the clipboard, too");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
g_object_set (hbox, "margin", 8, NULL);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
/* Create the first image */
image = gtk_image_new_from_icon_name ("dialog-warning");
+2 -2
View File
@@ -88,7 +88,7 @@ do_colorsel (GtkWidget *do_widget)
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
da = gtk_drawing_area_new ();
gtk_drawing_area_set_content_width (GTK_DRAWING_AREA (da), 200);
@@ -101,7 +101,7 @@ do_colorsel (GtkWidget *do_widget)
gtk_widget_set_halign (button, GTK_ALIGN_END);
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox), button);
gtk_container_add (GTK_CONTAINER (vbox), button);
g_signal_connect (button, "clicked",
G_CALLBACK (change_color_callback), NULL);
+4 -4
View File
@@ -326,7 +326,7 @@ do_combobox (GtkWidget *do_widget)
* insensitive rows
*/
frame = gtk_frame_new ("Items with icons");
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
g_object_set (box, "margin", 5, NULL);
@@ -367,7 +367,7 @@ do_combobox (GtkWidget *do_widget)
/* A combobox demonstrating trees.
*/
frame = gtk_frame_new ("Where are we ?");
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
g_object_set (box, "margin", 5, NULL);
@@ -395,7 +395,7 @@ do_combobox (GtkWidget *do_widget)
/* A GtkComboBoxEntry with validation */
frame = gtk_frame_new ("Editable");
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
g_object_set (box, "margin", 5, NULL);
@@ -413,7 +413,7 @@ do_combobox (GtkWidget *do_widget)
/* A combobox with string IDs */
frame = gtk_frame_new ("String IDs");
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
g_object_set (box, "margin", 5, NULL);
-9
View File
@@ -199,9 +199,6 @@
</object>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow1">
@@ -255,16 +252,10 @@
</object>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkStatusbar" id="statusbar1">
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
</object>
</child>
+10 -10
View File
@@ -56,16 +56,16 @@ interactive_dialog_clicked (GtkButton *button,
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
gtk_box_pack_start (GTK_BOX (content_area), hbox);
gtk_container_add (GTK_CONTAINER (content_area), hbox);
image = gtk_image_new_from_icon_name ("dialog-question");
gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
gtk_box_pack_start (GTK_BOX (hbox), image);
gtk_container_add (GTK_CONTAINER (hbox), image);
table = gtk_grid_new ();
gtk_grid_set_row_spacing (GTK_GRID (table), 4);
gtk_grid_set_column_spacing (GTK_GRID (table), 4);
gtk_box_pack_start (GTK_BOX (hbox), table);
gtk_container_add (GTK_CONTAINER (hbox), table);
label = gtk_label_new_with_mnemonic ("_Entry 1");
gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1);
local_entry1 = gtk_entry_new ();
@@ -123,29 +123,29 @@ do_dialog (GtkWidget *do_widget)
/* Standard message dialog */
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 ("_Message Dialog");
g_signal_connect (button, "clicked",
G_CALLBACK (message_dialog_clicked), NULL);
gtk_box_pack_start (GTK_BOX (hbox), button);
gtk_container_add (GTK_CONTAINER (hbox), button);
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));
/* Interactive dialog*/
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
button = gtk_button_new_with_mnemonic ("_Interactive Dialog");
g_signal_connect (button, "clicked",
G_CALLBACK (interactive_dialog_clicked), NULL);
gtk_box_pack_start (GTK_BOX (hbox), vbox2);
gtk_box_pack_start (GTK_BOX (vbox2), button);
gtk_container_add (GTK_CONTAINER (hbox), vbox2);
gtk_container_add (GTK_CONTAINER (vbox2), button);
table = gtk_grid_new ();
gtk_grid_set_row_spacing (GTK_GRID (table), 4);
gtk_grid_set_column_spacing (GTK_GRID (table), 4);
gtk_box_pack_start (GTK_BOX (hbox), table);
gtk_container_add (GTK_CONTAINER (hbox), table);
label = gtk_label_new_with_mnemonic ("_Entry 1");
gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1);
+1 -1
View File
@@ -352,7 +352,7 @@ do_dnd (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (window), vbox);
fixed = gtk_fixed_new ();
gtk_box_pack_start (GTK_BOX (vbox), fixed);
gtk_container_add (GTK_CONTAINER (vbox), fixed);
gtk_widget_set_hexpand (fixed, TRUE);
gtk_widget_set_vexpand (fixed, TRUE);
+4 -4
View File
@@ -208,12 +208,12 @@ do_drawingarea (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>Checkerboard pattern</u>");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_widget_set_vexpand (frame, TRUE);
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
da = gtk_drawing_area_new ();
gtk_drawing_area_set_content_width (GTK_DRAWING_AREA (da), 100);
@@ -228,12 +228,12 @@ do_drawingarea (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>Scribble area</u>");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
frame = gtk_frame_new (NULL);
gtk_widget_set_vexpand (frame, TRUE);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
da = gtk_drawing_area_new ();
gtk_drawing_area_set_content_width (GTK_DRAWING_AREA (da), 100);
+5 -5
View File
@@ -356,7 +356,7 @@ do_editable_cells (GtkWidget *do_widget)
g_object_set (vbox, "margin", 5, NULL);
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox),
gtk_label_new ("Shopping list (you can edit the cells!)"));
sw = gtk_scrolled_window_new (NULL, NULL);
@@ -365,7 +365,7 @@ do_editable_cells (GtkWidget *do_widget)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (vbox), sw);
gtk_container_add (GTK_CONTAINER (vbox), sw);
/* create models */
items_model = create_items_model ();
@@ -387,17 +387,17 @@ do_editable_cells (GtkWidget *do_widget)
/* some buttons */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
gtk_box_set_homogeneous (GTK_BOX (hbox), TRUE);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
button = gtk_button_new_with_label ("Add item");
g_signal_connect (button, "clicked",
G_CALLBACK (add_item), treeview);
gtk_box_pack_start (GTK_BOX (hbox), button);
gtk_container_add (GTK_CONTAINER (hbox), button);
button = gtk_button_new_with_label ("Remove item");
g_signal_connect (button, "clicked",
G_CALLBACK (remove_item), treeview);
gtk_box_pack_start (GTK_BOX (hbox), button);
gtk_container_add (GTK_CONTAINER (hbox), button);
gtk_window_set_default_size (GTK_WINDOW (window), 320, 200);
}
+3 -3
View File
@@ -34,19 +34,19 @@ do_entry_buffer (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"Entries share a buffer. Typing in one is reflected in the other.");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
/* Create a buffer */
buffer = gtk_entry_buffer_new (NULL, 0);
/* Create our first entry */
entry = gtk_entry_new_with_buffer (buffer);
gtk_box_pack_start (GTK_BOX (vbox), entry);
gtk_container_add (GTK_CONTAINER (vbox), entry);
/* Create the second entry */
entry = gtk_entry_new_with_buffer (buffer);
gtk_entry_set_visibility (GTK_ENTRY (entry), FALSE);
gtk_box_pack_start (GTK_BOX (vbox), entry);
gtk_container_add (GTK_CONTAINER (vbox), entry);
g_object_unref (buffer);
}
+2 -2
View File
@@ -60,11 +60,11 @@ do_entry_completion (GtkWidget *do_widget)
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 entry */
entry = gtk_entry_new ();
gtk_box_pack_start (GTK_BOX (vbox), entry);
gtk_container_add (GTK_CONTAINER (vbox), entry);
/* Create the completion object */
completion = gtk_entry_completion_new ();
+1 -1
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);
+2 -2
View File
@@ -266,7 +266,7 @@ do_iconview (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (window), vbox);
tool_bar = gtk_toolbar_new ();
gtk_box_pack_start (GTK_BOX (vbox), tool_bar);
gtk_container_add (GTK_CONTAINER (vbox), tool_bar);
up_button = gtk_tool_button_new (NULL, NULL);
gtk_tool_button_set_label (GTK_TOOL_BUTTON (up_button), _("_Up"));
@@ -292,7 +292,7 @@ do_iconview (GtkWidget *do_widget)
GTK_POLICY_AUTOMATIC);
gtk_widget_set_vexpand (sw, TRUE);
gtk_box_pack_start (GTK_BOX (vbox), sw);
gtk_container_add (GTK_CONTAINER (vbox), sw);
/* Create the store and fill it with the contents of '/' */
parent = g_strdup ("/");
+12 -12
View File
@@ -354,13 +354,13 @@ do_images (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>Image loaded from a file</u>");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_widget_set_halign (frame, GTK_ALIGN_CENTER);
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
image = gtk_image_new_from_icon_name ("gtk3-demo");
gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
@@ -373,13 +373,13 @@ do_images (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>Animation loaded from a file</u>");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_widget_set_halign (frame, GTK_ALIGN_CENTER);
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
picture = gtk_picture_new_for_resource ("/images/floppybuddy.gif");
@@ -390,13 +390,13 @@ do_images (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>Symbolic themed icon</u>");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_widget_set_halign (frame, GTK_ALIGN_CENTER);
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
gicon = g_themed_icon_new_with_default_fallbacks ("battery-caution-charging-symbolic");
image = gtk_image_new_from_gicon (gicon);
@@ -412,13 +412,13 @@ do_images (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>Progressive image loading</u>");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_widget_set_halign (frame, GTK_ALIGN_CENTER);
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
/* Create an empty image for now; the progressive loader
* will create the pixbuf and fill it in.
@@ -435,13 +435,13 @@ do_images (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>Displaying video</u>");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_widget_set_halign (frame, GTK_ALIGN_CENTER);
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
video = gtk_video_new_for_resource ("/images/gtk-logo.webm");
gtk_media_stream_set_loop (gtk_video_get_media_stream (GTK_VIDEO (video)), TRUE);
@@ -454,7 +454,7 @@ do_images (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>GtkWidgetPaintable</u>");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
paintable = gtk_widget_paintable_new (do_widget);
picture = gtk_picture_new_for_paintable (paintable);
@@ -464,7 +464,7 @@ do_images (GtkWidget *do_widget)
/* Sensitivity control */
button = gtk_toggle_button_new_with_mnemonic ("_Insensitive");
gtk_box_pack_start (GTK_BOX (base_vbox), button);
gtk_container_add (GTK_CONTAINER (base_vbox), button);
g_signal_connect (button, "toggled",
G_CALLBACK (toggle_sensitivity_callback),
+13 -13
View File
@@ -65,24 +65,24 @@ do_infobar (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (window), vbox);
bar = gtk_info_bar_new ();
gtk_box_pack_start (GTK_BOX (vbox), bar);
gtk_container_add (GTK_CONTAINER (vbox), bar);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_INFO);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_INFO");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
button = gtk_toggle_button_new_with_label ("Message");
g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
gtk_container_add (GTK_CONTAINER (actions), button);
bar = gtk_info_bar_new ();
gtk_box_pack_start (GTK_BOX (vbox), bar);
gtk_container_add (GTK_CONTAINER (vbox), bar);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_WARNING);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_WARNING");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
button = gtk_toggle_button_new_with_label ("Warning");
g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
@@ -91,24 +91,24 @@ do_infobar (GtkWidget *do_widget)
bar = gtk_info_bar_new_with_buttons (_("_OK"), GTK_RESPONSE_OK, NULL);
gtk_info_bar_set_show_close_button (GTK_INFO_BAR (bar), TRUE);
g_signal_connect (bar, "response", G_CALLBACK (on_bar_response), window);
gtk_box_pack_start (GTK_BOX (vbox), bar);
gtk_container_add (GTK_CONTAINER (vbox), bar);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_QUESTION);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_QUESTION");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
button = gtk_toggle_button_new_with_label ("Question");
g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
gtk_container_add (GTK_CONTAINER (actions), button);
bar = gtk_info_bar_new ();
gtk_box_pack_start (GTK_BOX (vbox), bar);
gtk_container_add (GTK_CONTAINER (vbox), bar);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_ERROR);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_ERROR");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
button = gtk_toggle_button_new_with_label ("Error");
g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
@@ -116,12 +116,12 @@ do_infobar (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (actions), button);
bar = gtk_info_bar_new ();
gtk_box_pack_start (GTK_BOX (vbox), bar);
gtk_container_add (GTK_CONTAINER (vbox), bar);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_OTHER);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_OTHER");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
button = gtk_toggle_button_new_with_label ("Other");
g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
@@ -130,7 +130,7 @@ do_infobar (GtkWidget *do_widget)
frame = gtk_frame_new ("Info bars");
gtk_widget_set_margin_top (frame, 8);
gtk_widget_set_margin_bottom (frame, 8);
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
g_object_set (vbox2, "margin", 8, NULL);
@@ -138,9 +138,9 @@ do_infobar (GtkWidget *do_widget)
/* Standard message dialog */
label = gtk_label_new ("An example of different info bars");
gtk_box_pack_start (GTK_BOX (vbox2), label);
gtk_container_add (GTK_CONTAINER (vbox2), label);
gtk_box_pack_start (GTK_BOX (vbox2), actions);
gtk_container_add (GTK_CONTAINER (vbox2), actions);
}
if (!gtk_widget_get_visible (window))
+2 -2
View File
@@ -268,7 +268,7 @@ do_list_store (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (window), vbox);
label = gtk_label_new ("This is the bug list (note: not based on real data, it would be nice to have a nice ODBC interface to bugzilla or so, though).");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
@@ -276,7 +276,7 @@ do_list_store (GtkWidget *do_widget)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (vbox), sw);
gtk_container_add (GTK_CONTAINER (vbox), sw);
/* create tree model */
model = create_model ();
+2 -2
View File
@@ -362,11 +362,11 @@ do_listbox (GtkWidget *do_widget)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
gtk_container_add (GTK_CONTAINER (window), vbox);
label = gtk_label_new ("Messages from Gtk+ and friends");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
scrolled = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
gtk_widget_set_vexpand (scrolled, TRUE);
gtk_box_pack_start (GTK_BOX (vbox), scrolled);
gtk_container_add (GTK_CONTAINER (vbox), scrolled);
listbox = gtk_list_box_new ();
gtk_container_add (GTK_CONTAINER (scrolled), listbox);
-37
View File
@@ -67,9 +67,6 @@
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="short_time_label">
@@ -79,10 +76,6 @@
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="pack-type">end</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
@@ -118,9 +111,6 @@
<object class="GtkLabel" id="label4">
<property name="label" translatable="yes">Resent by</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLinkButton" id="resent_by_button">
@@ -130,9 +120,6 @@
<property name="relief">none</property>
<property name="uri">http://www.gtk.org</property>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
@@ -172,9 +159,6 @@
<property name="relief">none</property>
<signal name="clicked" handler="reshare_clicked" swapped="yes"/>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="favorite-buttton">
@@ -184,9 +168,6 @@
<property name="relief">none</property>
<signal name="clicked" handler="favorite_clicked" swapped="yes"/>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkMenuButton" id="more-button">
@@ -200,14 +181,8 @@
</object>
</child>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
@@ -250,14 +225,8 @@ FAVORITES</property>
</child>
<child type="label_item"/>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box6">
@@ -279,14 +248,8 @@ FAVORITES</property>
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
-3
View File
@@ -152,9 +152,6 @@
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
+4 -4
View File
@@ -115,7 +115,7 @@ do_menus (GtkWidget *do_widget)
menubar = gtk_menu_bar_new ();
gtk_widget_set_hexpand (menubar, TRUE);
gtk_box_pack_start (GTK_BOX (box1), menubar);
gtk_container_add (GTK_CONTAINER (box1), menubar);
gtk_widget_show (menubar);
menu = create_menu (2);
@@ -136,19 +136,19 @@ do_menus (GtkWidget *do_widget)
gtk_widget_show (menuitem);
box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
gtk_box_pack_start (GTK_BOX (box1), box2);
gtk_container_add (GTK_CONTAINER (box1), box2);
gtk_widget_show (box2);
button = gtk_button_new_with_label ("Flip");
g_signal_connect (button, "clicked",
G_CALLBACK (change_orientation), menubar);
gtk_box_pack_start (GTK_BOX (box2), button);
gtk_container_add (GTK_CONTAINER (box2), button);
gtk_widget_show (button);
button = gtk_button_new_with_label ("Close");
g_signal_connect_swapped (button, "clicked",
G_CALLBACK(gtk_widget_destroy), window);
gtk_box_pack_start (GTK_BOX (box2), button);
gtk_container_add (GTK_CONTAINER (box2), button);
gtk_widget_set_can_default (button, TRUE);
gtk_widget_grab_default (button);
gtk_widget_show (button);
+2 -2
View File
@@ -65,7 +65,7 @@ do_overlay (GtkWidget *do_widget)
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
gtk_widget_set_margin_top (label, 8);
gtk_widget_set_margin_bottom (label, 50);
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), vbox);
@@ -74,7 +74,7 @@ do_overlay (GtkWidget *do_widget)
gtk_entry_set_placeholder_text (GTK_ENTRY (entry), "Your Lucky Number");
gtk_widget_set_margin_top (entry, 50);
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 (window), overlay);
+3 -3
View File
@@ -148,7 +148,7 @@ do_panes (GtkWidget *do_widget)
vpaned = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
g_object_set (vpaned, "margin", 5, NULL);
gtk_box_pack_start (GTK_BOX (vbox), vpaned);
gtk_container_add (GTK_CONTAINER (vbox), vpaned);
hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
gtk_paned_add1 (GTK_PANED (vpaned), hpaned);
@@ -173,13 +173,13 @@ do_panes (GtkWidget *do_widget)
/* Now create toggle buttons to control sizing */
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox),
create_pane_options (GTK_PANED (hpaned),
"Horizontal",
"Left",
"Right"));
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox),
create_pane_options (GTK_PANED (vpaned),
"Vertical",
"Top",
-3
View File
@@ -81,9 +81,6 @@
</object>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
+4 -4
View File
@@ -240,20 +240,20 @@ do_search_entry (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label), "Search entry demo");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
/* Create our entry */
entry = gtk_search_entry_new ();
gtk_box_pack_start (GTK_BOX (hbox), entry);
gtk_container_add (GTK_CONTAINER (hbox), entry);
/* Create the find and cancel buttons */
notebook = gtk_notebook_new ();
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE);
gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE);
gtk_box_pack_start (GTK_BOX (hbox), notebook);
gtk_container_add (GTK_CONTAINER (hbox), notebook);
find_button = gtk_button_new_with_label ("Find");
g_signal_connect (find_button, "clicked",
+10 -10
View File
@@ -83,38 +83,38 @@ do_search_entry2 (GtkWidget *do_widget)
entry = gtk_search_entry_new ();
container = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
gtk_widget_set_halign (container, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (container), entry);
gtk_container_add (GTK_CONTAINER (container), entry);
searchbar = gtk_search_bar_new ();
gtk_search_bar_connect_entry (GTK_SEARCH_BAR (searchbar), GTK_ENTRY (entry));
gtk_search_bar_set_show_close_button (GTK_SEARCH_BAR (searchbar), FALSE);
gtk_container_add (GTK_CONTAINER (searchbar), container);
gtk_box_pack_start (GTK_BOX (vbox), searchbar);
gtk_container_add (GTK_CONTAINER (vbox), searchbar);
/* Hook the search bar to key presses */
gtk_search_bar_set_key_capture_widget (GTK_SEARCH_BAR (searchbar), window);
/* Help */
label = gtk_label_new ("Start Typing to search");
gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_container_add (GTK_CONTAINER (vbox), label);
/* Toggle button */
button = gtk_toggle_button_new_with_label ("Search");
g_object_bind_property (button, "active",
searchbar, "search-mode-enabled",
G_BINDING_BIDIRECTIONAL);
gtk_box_pack_start (GTK_BOX (vbox), button);
gtk_container_add (GTK_CONTAINER (vbox), button);
/* Result */
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 ("Result:");
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
gtk_widget_set_margin_start (label, 6);
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_container_add (GTK_CONTAINER (hbox), label);
g_signal_connect (entry, "search-changed",
G_CALLBACK (search_changed_cb), label);
@@ -122,15 +122,15 @@ do_search_entry2 (GtkWidget *do_widget)
G_CALLBACK (changed_cb), label);
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 ("Signal:");
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
gtk_widget_set_margin_start (label, 6);
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_container_add (GTK_CONTAINER (hbox), label);
g_signal_connect (entry, "search-changed",
G_CALLBACK (search_changed), label);
+3 -3
View File
@@ -49,7 +49,7 @@ do_sidebar (GtkWidget *do_widget)
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
sidebar = gtk_stack_sidebar_new ();
gtk_box_pack_start (GTK_BOX (box), sidebar);
gtk_container_add (GTK_CONTAINER (box), sidebar);
stack = gtk_stack_new ();
gtk_stack_set_transition_type (GTK_STACK (stack), GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN);
@@ -57,9 +57,9 @@ do_sidebar (GtkWidget *do_widget)
/* Separator between sidebar and stack */
widget = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
gtk_box_pack_start (GTK_BOX(box), widget);
gtk_container_add (GTK_CONTAINER(box), widget);
gtk_box_pack_start (GTK_BOX (box), stack);
gtk_container_add (GTK_CONTAINER (box), stack);
for (i=0; (c = *(pages+i)) != NULL; i++ )
{
+3 -3
View File
@@ -116,7 +116,7 @@ do_sizegroup (GtkWidget *do_widget)
/* Create one frame holding color options */
frame = gtk_frame_new ("Color Options");
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
table = gtk_grid_new ();
g_object_set (table, "margin", 5, NULL);
@@ -129,7 +129,7 @@ do_sizegroup (GtkWidget *do_widget)
/* And another frame holding line style options */
frame = gtk_frame_new ("Line Options");
gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_container_add (GTK_CONTAINER (vbox), frame);
table = gtk_grid_new ();
g_object_set (table, "margin", 5, NULL);
@@ -142,7 +142,7 @@ do_sizegroup (GtkWidget *do_widget)
/* And a check button to turn grouping on and off */
check_button = gtk_check_button_new_with_mnemonic ("_Enable grouping");
gtk_box_pack_start (GTK_BOX (vbox), check_button);
gtk_container_add (GTK_CONTAINER (vbox), check_button);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button), TRUE);
g_signal_connect (check_button, "toggled",
+1 -1
View File
@@ -53,7 +53,7 @@ do_spinner (GtkWidget *do_widget)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
g_object_set (vbox, "margin", 5, NULL);
gtk_box_pack_start (GTK_BOX (content_area), vbox);
gtk_container_add (GTK_CONTAINER (content_area), vbox);
/* Sensitive */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
+1 -1
View File
@@ -157,7 +157,7 @@ create_text_view (GtkWidget *hbox,
guint timeout;
swindow = gtk_scrolled_window_new (NULL, NULL);
gtk_box_pack_start (GTK_BOX (hbox), swindow);
gtk_container_add (GTK_CONTAINER (hbox), swindow);
textview = gtk_text_view_new ();
gtk_container_add (GTK_CONTAINER (swindow), textview);
-6
View File
@@ -131,9 +131,6 @@
<property name="can-focus">1</property>
<property name="receives-default">1</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton">
@@ -141,9 +138,6 @@
<property name="can-focus">1</property>
<property name="receives-default">1</property>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
+2 -2
View File
@@ -401,7 +401,7 @@ do_tree_store (GtkWidget *do_widget)
g_object_set (vbox, "margin", 8, NULL);
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox),
gtk_label_new ("Jonathan's Holiday Card Planning Sheet"));
sw = gtk_scrolled_window_new (NULL, NULL);
@@ -410,7 +410,7 @@ do_tree_store (GtkWidget *do_widget)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (vbox), sw);
gtk_container_add (GTK_CONTAINER (vbox), sw);
/* create model */
model = create_model ();
+4 -4
View File
@@ -803,7 +803,7 @@ overshot (GtkScrolledWindow *sw, GtkPositionType pos, GtkWidget *widget)
"margin", 6,
"xalign", 0.0,
NULL);
gtk_box_pack_start (GTK_BOX (row), label);
gtk_container_add (GTK_CONTAINER (row), label);
gdk_rgba_parse (&rgba, color);
swatch = g_object_new (g_type_from_name ("GtkColorSwatch"),
"rgba", &rgba,
@@ -815,7 +815,7 @@ overshot (GtkScrolledWindow *sw, GtkPositionType pos, GtkWidget *widget)
NULL);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_add (GTK_CONTAINER (box), swatch);
gtk_box_pack_start (GTK_BOX (row), box);
gtk_container_add (GTK_CONTAINER (row), box);
gtk_list_box_insert (GTK_LIST_BOX (widget), row, -1);
row = gtk_widget_get_parent (row);
gtk_list_box_row_set_activatable (GTK_LIST_BOX_ROW (row), FALSE);
@@ -914,7 +914,7 @@ populate_colors (GtkWidget *widget, GtkWidget *chooser)
"hexpand", TRUE,
"xalign", 0.0,
NULL);
gtk_box_pack_start (GTK_BOX (row), label);
gtk_container_add (GTK_CONTAINER (row), label);
gdk_rgba_parse (&rgba, colors[i].color);
swatch = g_object_new (g_type_from_name ("GtkColorSwatch"),
"rgba", &rgba,
@@ -926,7 +926,7 @@ populate_colors (GtkWidget *widget, GtkWidget *chooser)
NULL);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_add (GTK_CONTAINER (box), swatch);
gtk_box_pack_start (GTK_BOX (row), box);
gtk_container_add (GTK_CONTAINER (row), box);
gtk_list_box_insert (GTK_LIST_BOX (widget), row, -1);
row = gtk_widget_get_parent (row);
gtk_list_box_row_set_activatable (GTK_LIST_BOX_ROW (row), FALSE);
+3 -159
View File
@@ -472,9 +472,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</object>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="entry1">
@@ -486,9 +483,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="secondary-icon-tooltip-text">Change mode</property>
<signal name="icon-release" handler="on_entry_icon_release" swapped="no"/>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="entry2">
@@ -497,9 +491,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="invisible-char">•</property>
<property name="text" translatable="yes">entry</property>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box223">
@@ -519,14 +510,8 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="can-focus">1</property>
<property name="icon-name">window-close-symbolic</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkBox">
@@ -588,9 +573,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="sensitive">0</property>
<property name="label" translatable="yes">label</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spinbutton1">
@@ -599,9 +581,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="max-width-chars">2</property>
<property name="adjustment">adjustment2</property>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spinbutton2">
@@ -610,9 +589,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="width-chars">2</property>
<property name="max-width-chars">2</property>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
</object>
</child>
@@ -806,9 +782,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<object class="GtkSeparator" id="separator1">
<property name="orientation">vertical</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box19">
@@ -828,9 +801,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="can-focus">1</property>
<property name="receives-default">1</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="togglebutton3">
@@ -839,9 +809,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="receives-default">1</property>
<property name="active">1</property>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="togglebutton4">
@@ -851,9 +818,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="receives-default">1</property>
<property name="active">1</property>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="combobox1">
@@ -866,9 +830,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</attributes>
</child>
</object>
<packing>
<property name="position">5</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="combobox2">
@@ -882,9 +843,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</attributes>
</child>
</object>
<packing>
<property name="position">6</property>
</packing>
</child>
<child>
<object class="GtkFontButton" id="fontbutton1">
@@ -892,9 +850,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="receives-default">1</property>
<property name="level">family|style|size|features|variations</property>
</object>
<packing>
<property name="position">6</property>
</packing>
</child>
<child>
<object class="GtkColorButton" id="colorbutton1">
@@ -903,16 +858,10 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="rgba">#31316867a09f</property>
<property name="use-alpha">1</property>
</object>
<packing>
<property name="position">8</property>
</packing>
</child>
<child>
<object class="GtkFileChooserButton" id="filechooserbutton1">
</object>
<packing>
<property name="position">8</property>
</packing>
</child>
<child>
<object class="GtkLinkButton" id="linkbutton1">
@@ -923,39 +872,24 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="relief">none</property>
<property name="uri">http://www.gtk.org</property>
</object>
<packing>
<property name="position">9</property>
</packing>
</child>
<child>
<object class="GtkSwitch" id="switch1">
<property name="halign">center</property>
</object>
<packing>
<property name="position">10</property>
</packing>
</child>
<child>
<object class="GtkSwitch" id="switch2">
<property name="sensitive">0</property>
<property name="halign">center</property>
</object>
<packing>
<property name="position">11</property>
</packing>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkSeparator" id="separator2">
<property name="orientation">vertical</property>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box20">
@@ -976,26 +910,17 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="fraction">0.5</property>
<property name="inverted">1</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkProgressBar" id="progressbar3">
<property name="fraction">0.5</property>
<property name="show-text">1</property>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkLevelBar" id="levelbar1">
<property name="value">0.6</property>
</object>
<packing>
<property name="position">10</property>
</packing>
</child>
<child>
<object class="GtkLevelBar" id="levelbar2">
@@ -1008,9 +933,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<offset name="full" value="5"/>
</offsets>
</object>
<packing>
<property name="position">11</property>
</packing>
</child>
</object>
</child>
@@ -1039,16 +961,10 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="fill-level">75</property>
<property name="draw-value">0</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkScale" id="scale5">
@@ -1066,9 +982,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<mark value="4" position="bottom"></mark>
</marks>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box25">
@@ -1092,9 +1005,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="inverted">1</property>
<property name="halign">start</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
@@ -1129,32 +1039,17 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="halign">start</property>
<signal name="format-value" handler="scale_format_value_blank"/>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkSeparator" id="separator3">
<property name="orientation">vertical</property>
</object>
<packing>
<property name="position">5</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box26">
@@ -1187,9 +1082,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</object>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame3">
@@ -1203,9 +1095,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</object>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame4">
@@ -1219,22 +1108,13 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</object>
</child>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="position">6</property>
</packing>
</child>
<child>
<object class="GtkSeparator" id="separator4">
<property name="orientation">vertical</property>
</object>
<packing>
<property name="position">7</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box4">
@@ -1335,25 +1215,13 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</object>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">8</property>
</packing>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkSeparator" id="separator5"/>
<packing>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box5">
@@ -1379,9 +1247,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<object class="GtkBox" id="box7">
<property name="orientation">vertical</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="label6">
@@ -1463,9 +1328,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkNotebook" id="notebook3">
@@ -1519,9 +1381,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</packing>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkNotebook" id="notebook4">
@@ -1575,14 +1434,8 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</packing>
</child>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="position">4</property>
</packing>
</child>
</object>
<packing>
@@ -3057,9 +2910,6 @@ microphone-sensitivity-medium-symbolic</property>
<class name="small-button"/>
</style>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
</object>
</child>
@@ -3090,9 +2940,6 @@ microphone-sensitivity-medium-symbolic</property>
<class name="small-button"/>
</style>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
</object>
</child>
@@ -3151,9 +2998,6 @@ microphone-sensitivity-medium-symbolic</property>
<property name="show-emoji-icon">1</property>
<property name="placeholder-text" translatable="yes">Age…</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<style>
<class name="linked"/>
@@ -3289,7 +3133,7 @@ bad things might happen.</property>
<property name="use-header-bar">1</property>
<property name="title" translatable="yes">Zelda</property>
<property name="hide-on-close">1</property>
<child internal-child="vbox">
<child internal-child="content_area">
<object class="GtkBox">
<child>
<object class="GtkLabel">
@@ -3328,7 +3172,7 @@ bad things might happen.</property>
<property name="use-header-bar">1</property>
<property name="title" translatable="yes">Settings</property>
<property name="hide-on-close">1</property>
<child internal-child="vbox">
<child internal-child="content_area">
<object class="GtkBox">
<child>
<object class="GtkGrid">
@@ -3449,7 +3293,7 @@ bad things might happen.</property>
<property name="use-header-bar">1</property>
<property name="title" translatable="yes">Choose one</property>
<property name="hide-on-close">1</property>
<child internal-child="vbox">
<child internal-child="content_area">
<object class="GtkBox">
<child>
<object class="GtkFlowBox" id="selection_flowbox">
+2 -5
View File
@@ -322,17 +322,14 @@ gtk_bin_get_type
GtkBox
GtkBoxClass
gtk_box_new
gtk_box_pack_start
gtk_box_pack_end
gtk_box_get_homogeneous
gtk_box_set_homogeneous
gtk_box_get_spacing
gtk_box_set_spacing
gtk_box_reorder_child
gtk_box_query_child_packing
gtk_box_set_child_packing
gtk_box_get_baseline_position
gtk_box_set_baseline_position
gtk_box_insert_child_after
gtk_box_reorder_child_after
<SUBSECTION Standard>
GTK_BOX
GTK_IS_BOX
+11
View File
@@ -193,6 +193,17 @@
</para>
</section>
<section>
<title>Stop using GtkBox's pack-type child property</title>
<para>
In order to improve performance and simplify the widget, GtkBox lost its
'pack-type' child property. In GTK+4, every GtkBox instance has a simple
list of child widgets that it allocates from start to end.
The old behavior of pack-type=END can be emulated by simply making the
box child in the center hexpand and right-align the ones at the end.
</para>
</section>
</section>
<section>
+63 -63
View File
@@ -160,7 +160,7 @@ create_menu_button (void)
gtk_widget_set_halign (widget, GTK_ALIGN_CENTER);
gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new ("Menu Button"));
gtk_container_add (GTK_CONTAINER (vbox), gtk_label_new ("Menu Button"));
return new_widget_info ("menu-button", vbox, SMALL);
}
@@ -209,8 +209,8 @@ create_lockbutton (void)
widget = gtk_lock_button_new (g_object_new (G_TYPE_TEST_PERMISSION, NULL));
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
gtk_box_pack_start (GTK_BOX (vbox), widget);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox), widget);
gtk_container_add (GTK_CONTAINER (vbox),
gtk_label_new ("Lock Button"));
gtk_widget_set_halign (vbox, GTK_ALIGN_CENTER);
gtk_widget_set_valign (vbox, GTK_ALIGN_CENTER);
@@ -253,11 +253,11 @@ create_radio (void)
widget = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
radio = gtk_radio_button_new_with_mnemonic (NULL, "Radio Button _One");
gtk_box_pack_start (GTK_BOX (widget), radio);
gtk_container_add (GTK_CONTAINER (widget), radio);
radio = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON (radio), "Radio Button _Two");
gtk_box_pack_start (GTK_BOX (widget), radio);
gtk_container_add (GTK_CONTAINER (widget), radio);
radio = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON (radio), "Radio Button T_hree");
gtk_box_pack_start (GTK_BOX (widget), radio);
gtk_container_add (GTK_CONTAINER (widget), radio);
gtk_widget_set_halign (widget, GTK_ALIGN_CENTER);
gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
@@ -409,7 +409,7 @@ create_search_bar (void)
gtk_container_add (GTK_CONTAINER (box), widget);
view = gtk_text_view_new ();
gtk_box_pack_start (GTK_BOX (box), view);
gtk_container_add (GTK_CONTAINER (box), view);
info = new_widget_info ("search-bar", box, SMALL);
@@ -427,7 +427,7 @@ create_action_bar (void)
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
view = gtk_text_view_new ();
gtk_box_pack_start (GTK_BOX (box), view);
gtk_container_add (GTK_CONTAINER (box), view);
widget = gtk_action_bar_new ();
@@ -538,8 +538,8 @@ create_icon_view (void)
gtk_container_add (GTK_CONTAINER (widget), icon_view);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
gtk_box_pack_start (GTK_BOX (vbox), widget);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox), widget);
gtk_container_add (GTK_CONTAINER (vbox),
gtk_label_new ("Icon View"));
info = new_widget_info ("icon-view", vbox, MEDIUM);
@@ -562,8 +562,8 @@ create_color_button (void)
picker = gtk_color_button_new_with_rgba (&color);
gtk_widget_set_halign (picker, GTK_ALIGN_CENTER);
gtk_widget_set_valign (picker, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox), picker);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox), picker);
gtk_container_add (GTK_CONTAINER (vbox),
gtk_label_new ("Color Button"));
return new_widget_info ("color-button", vbox, SMALL);
@@ -579,8 +579,8 @@ create_font_button (void)
picker = gtk_font_button_new_with_font ("Sans Serif 10");
gtk_widget_set_halign (picker, GTK_ALIGN_CENTER);
gtk_widget_set_valign (picker, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox), picker);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox), picker);
gtk_container_add (GTK_CONTAINER (vbox),
gtk_label_new ("Font Button"));
return new_widget_info ("font-button", vbox, SMALL);
@@ -601,13 +601,13 @@ create_file_button (void)
gtk_widget_set_size_request (picker, 150, -1);
gtk_widget_set_halign (picker, GTK_ALIGN_CENTER);
gtk_widget_set_valign (picker, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox2), picker);
gtk_box_pack_start (GTK_BOX (vbox2),
gtk_container_add (GTK_CONTAINER (vbox2), picker);
gtk_container_add (GTK_CONTAINER (vbox2),
gtk_label_new ("File Button (Files)"));
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox),
vbox2);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox),
gtk_separator_new (GTK_ORIENTATION_HORIZONTAL));
vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
@@ -619,10 +619,10 @@ create_file_button (void)
g_free (path);
gtk_widget_set_halign (picker, GTK_ALIGN_CENTER);
gtk_widget_set_valign (picker, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox2), picker);
gtk_box_pack_start (GTK_BOX (vbox2),
gtk_container_add (GTK_CONTAINER (vbox2), picker);
gtk_container_add (GTK_CONTAINER (vbox2),
gtk_label_new ("File Button (Select Folder)"));
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox),
vbox2);
return new_widget_info ("file-button", vbox, MEDIUM);
@@ -637,12 +637,12 @@ create_separator (void)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_set_homogeneous (GTK_BOX (hbox), TRUE);
gtk_box_pack_start (GTK_BOX (hbox),
gtk_container_add (GTK_CONTAINER (hbox),
gtk_separator_new (GTK_ORIENTATION_HORIZONTAL));
gtk_box_pack_start (GTK_BOX (hbox),
gtk_container_add (GTK_CONTAINER (hbox),
gtk_separator_new (GTK_ORIENTATION_VERTICAL));
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox),
g_object_new (GTK_TYPE_LABEL,
"label", "Horizontal and Vertical\nSeparators",
"justify", GTK_JUSTIFY_CENTER,
@@ -671,7 +671,7 @@ create_panes (void)
"shadow-type", GTK_SHADOW_IN,
NULL),
FALSE, FALSE);
gtk_box_pack_start (GTK_BOX (hbox),
gtk_container_add (GTK_CONTAINER (hbox),
pane);
pane = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
gtk_paned_pack1 (GTK_PANED (pane),
@@ -684,10 +684,10 @@ create_panes (void)
"shadow-type", GTK_SHADOW_IN,
NULL),
FALSE, FALSE);
gtk_box_pack_start (GTK_BOX (hbox),
gtk_container_add (GTK_CONTAINER (hbox),
pane);
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox),
g_object_new (GTK_TYPE_LABEL,
"label", "Horizontal and Vertical\nPanes",
"justify", GTK_JUSTIFY_CENTER,
@@ -819,8 +819,8 @@ create_menubar (void)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
gtk_widget_set_halign (widget, GTK_ALIGN_FILL);
gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox), widget);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox), widget);
gtk_container_add (GTK_CONTAINER (vbox),
gtk_label_new ("Menu Bar"));
return new_widget_info ("menubar", vbox, SMALL);
@@ -901,8 +901,8 @@ create_progressbar (void)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
gtk_widget_set_halign (widget, GTK_ALIGN_FILL);
gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox), widget);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox), widget);
gtk_container_add (GTK_CONTAINER (vbox),
gtk_label_new ("Progress Bar"));
return new_widget_info ("progressbar", vbox, SMALL);
@@ -918,8 +918,8 @@ create_level_bar (void)
gtk_level_bar_set_value (GTK_LEVEL_BAR (widget), 0.333);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
gtk_box_pack_start (GTK_BOX (vbox), widget);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox), widget);
gtk_container_add (GTK_CONTAINER (vbox),
gtk_label_new ("Level Bar"));
return new_widget_info ("levelbar", vbox, SMALL);
@@ -952,8 +952,8 @@ create_scrollbar (void)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
gtk_widget_set_halign (widget, GTK_ALIGN_FILL);
gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox), widget);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox), widget);
gtk_container_add (GTK_CONTAINER (vbox),
gtk_label_new ("Scrollbar"));
return new_widget_info ("scrollbar", vbox, SMALL);
@@ -970,8 +970,8 @@ create_spinbutton (void)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
gtk_widget_set_halign (widget, GTK_ALIGN_FILL);
gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox), widget);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox), widget);
gtk_container_add (GTK_CONTAINER (vbox),
gtk_label_new ("Spin Button"));
return new_widget_info ("spinbutton", vbox, SMALL);
@@ -985,13 +985,13 @@ create_statusbar (void)
GtkWidget *vbox;
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox),
gtk_label_new ("Status Bar"));
widget = gtk_statusbar_new ();
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);
@@ -1007,14 +1007,14 @@ create_scales (void)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_set_homogeneous (GTK_BOX (hbox), TRUE);
gtk_box_pack_start (GTK_BOX (hbox),
gtk_container_add (GTK_CONTAINER (hbox),
gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL,
0.0, 100.0, 1.0));
gtk_box_pack_start (GTK_BOX (hbox),
gtk_container_add (GTK_CONTAINER (hbox),
gtk_scale_new_with_range (GTK_ORIENTATION_VERTICAL,
0.0, 100.0, 1.0));
gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox), hbox);
gtk_container_add (GTK_CONTAINER (vbox),
g_object_new (GTK_TYPE_LABEL,
"label", "Horizontal and Vertical\nScales",
"justify", GTK_JUSTIFY_CENTER,
@@ -1033,8 +1033,8 @@ create_image (void)
gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
gtk_box_pack_start (GTK_BOX (vbox), widget);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox), widget);
gtk_container_add (GTK_CONTAINER (vbox),
gtk_label_new ("Image"));
return new_widget_info ("image", vbox, SMALL);
@@ -1053,8 +1053,8 @@ create_spinner (void)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
gtk_widget_set_halign (widget, GTK_ALIGN_CENTER);
gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox), widget);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox), widget);
gtk_container_add (GTK_CONTAINER (vbox),
gtk_label_new ("Spinner"));
return new_widget_info ("spinner", 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));
@@ -1123,8 +1123,8 @@ create_appchooserbutton (void)
picker = gtk_app_chooser_button_new ("text/plain");
gtk_widget_set_halign (picker, GTK_ALIGN_CENTER);
gtk_widget_set_valign (picker, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox), picker);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox), picker);
gtk_container_add (GTK_CONTAINER (vbox),
gtk_label_new ("Application Button"));
return new_widget_info ("appchooserbutton", vbox, SMALL);
@@ -1221,9 +1221,9 @@ create_stack (void)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_box_pack_start (GTK_BOX (vbox), switcher);
gtk_box_pack_start (GTK_BOX (vbox), stack);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox), switcher);
gtk_container_add (GTK_CONTAINER (vbox), stack);
gtk_container_add (GTK_CONTAINER (vbox),
gtk_label_new ("Stack"));
return new_widget_info ("stack", vbox, ASIS);
@@ -1254,9 +1254,9 @@ create_stack_switcher (void)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_box_pack_start (GTK_BOX (vbox), switcher);
gtk_box_pack_start (GTK_BOX (vbox), stack);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_container_add (GTK_CONTAINER (vbox), switcher);
gtk_container_add (GTK_CONTAINER (vbox), stack);
gtk_container_add (GTK_CONTAINER (vbox),
gtk_label_new ("Stack Switcher"));
return new_widget_info ("stackswitcher", vbox, ASIS);
@@ -1289,9 +1289,9 @@ create_sidebar (void)
frame = gtk_frame_new (NULL);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (hbox), sidebar);
gtk_box_pack_start (GTK_BOX (hbox), gtk_separator_new (GTK_ORIENTATION_VERTICAL));
gtk_box_pack_start (GTK_BOX (hbox), stack);
gtk_container_add (GTK_CONTAINER (hbox), sidebar);
gtk_container_add (GTK_CONTAINER (hbox), gtk_separator_new (GTK_ORIENTATION_VERTICAL));
gtk_container_add (GTK_CONTAINER (hbox), stack);
gtk_container_add (GTK_CONTAINER (frame), hbox);
return new_widget_info ("sidebar", frame, ASIS);
@@ -1383,8 +1383,8 @@ create_flow_box (void)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_box_pack_start (GTK_BOX (vbox), widget);
gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new ("Flow Box"));
gtk_container_add (GTK_CONTAINER (vbox), widget);
gtk_container_add (GTK_CONTAINER (vbox), gtk_label_new ("Flow Box"));
info = new_widget_info ("flow-box", vbox, ASIS);
info->no_focus = FALSE;
+2 -2
View File
@@ -23,10 +23,10 @@ activate_cb (GtkApplication *app,
entry = gtk_search_entry_new ();
gtk_widget_set_hexpand (entry, TRUE);
gtk_box_pack_start (GTK_BOX (box), entry);
gtk_container_add (GTK_CONTAINER (box), entry);
menu_button = gtk_menu_button_new ();
gtk_box_pack_start (GTK_BOX (box), menu_button);
gtk_container_add (GTK_CONTAINER (box), menu_button);
gtk_search_bar_connect_entry (GTK_SEARCH_BAR (search_bar), GTK_ENTRY (entry));
gtk_search_bar_set_key_capture_widget (GTK_SEARCH_BAR (search_bar), window);
+2 -56
View File
@@ -64,7 +64,6 @@ struct _GtkActionBarPrivate
enum {
CHILD_PROP_0,
CHILD_PROP_PACK_TYPE,
CHILD_PROP_POSITION
};
enum {
@@ -161,31 +160,6 @@ gtk_action_bar_get_child_property (GtkContainer *container,
break;
case CHILD_PROP_POSITION:
if (gtk_widget_get_parent (child) == priv->start_box)
{
int n;
gtk_container_child_get (GTK_CONTAINER (priv->start_box),
child,
"position", &n,
NULL);
g_value_set_int (value, n);
}
else if (gtk_widget_get_parent (child) == priv->end_box)
{
int n;
gtk_container_child_get (GTK_CONTAINER (priv->end_box),
child,
"position", &n,
NULL);
g_value_set_int (value, n);
}
else /* Center widget */
{
g_value_set_int (value, 0);
}
break;
default:
GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID (container, property_id, pspec);
break;
@@ -210,7 +184,7 @@ 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_box_insert_child_after (GTK_BOX (priv->end_box), child, NULL);
g_object_unref (child);
}
}
@@ -231,27 +205,6 @@ gtk_action_bar_set_child_property (GtkContainer *container,
break;
case CHILD_PROP_POSITION:
if (gtk_widget_get_parent (child) == priv->start_box)
{
gtk_container_child_set (GTK_CONTAINER (priv->start_box),
child,
"position", g_value_get_int (value),
NULL);
}
else if (gtk_widget_get_parent (child) == priv->end_box)
{
gtk_container_child_set (GTK_CONTAINER (priv->end_box),
child,
"position", g_value_get_int (value),
NULL);
}
else
{
/* Ignore center widget */
}
break;
default:
GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID (container, property_id, pspec);
break;
@@ -379,13 +332,6 @@ gtk_action_bar_class_init (GtkActionBarClass *klass)
P_("A GtkPackType indicating whether the child is packed with reference to the start or end of the parent"),
GTK_TYPE_PACK_TYPE, GTK_PACK_START,
G_PARAM_READWRITE));
gtk_container_class_install_child_property (container_class,
CHILD_PROP_POSITION,
g_param_spec_int ("position",
P_("Position"),
P_("The index of the child in the parent"),
-1, G_MAXINT, 0,
G_PARAM_READWRITE));
props[PROP_REVEALED] =
g_param_spec_boolean ("revealed",
@@ -478,7 +424,7 @@ 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_box_insert_child_after (GTK_BOX (priv->end_box), child, NULL);
}
/**
+3 -3
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));
+16 -7
View File
@@ -1125,7 +1125,7 @@ gtk_assistant_init (GtkAssistant *assistant)
buttons = gtk_container_get_children (GTK_CONTAINER (priv->action_area));
for (l = buttons; l; l = l->next)
gtk_box_reorder_child (GTK_BOX (priv->action_area), GTK_WIDGET (l->data), -1);
gtk_box_reorder_child_after (GTK_BOX (priv->action_area), GTK_WIDGET (l->data), NULL);
g_list_free (buttons);
}
@@ -1644,6 +1644,7 @@ gtk_assistant_insert_page (GtkAssistant *assistant,
gint n_pages;
GtkStyleContext *context;
GtkWidget *box;
GtkWidget *sibling;
g_return_val_if_fail (GTK_IS_ASSISTANT (assistant), 0);
g_return_val_if_fail (GTK_IS_WIDGET (page), 0);
@@ -1686,14 +1687,22 @@ 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_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);
if (position == 0)
sibling = NULL;
else
{
int i;
sibling = gtk_widget_get_first_child (priv->sidebar);
for (i = 1; i < 2 * position; i++)
sibling = gtk_widget_get_next_sibling (sibling);
}
gtk_box_insert_child_after (GTK_BOX (priv->sidebar), page_info->current_title, sibling);
gtk_box_insert_child_after (GTK_BOX (priv->sidebar), page_info->regular_title, sibling);
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 +1801,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);
}
/**
+1 -11
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;
@@ -394,9 +386,7 @@ gtk_button_box_set_child_secondary (GtkButtonBox *widget,
gtk_widget_child_notify (child, "secondary");
if (bbox->priv->layout_style == GTK_BUTTONBOX_EXPAND)
{
gtk_box_reorder_child (GTK_BOX (bbox), child, is_secondary ? 0 : -1);
}
gtk_box_reorder_child_after (GTK_BOX (bbox), child, is_secondary ? NULL : gtk_widget_get_last_child (GTK_WIDGET (bbox)));
if (gtk_widget_get_visible (GTK_WIDGET (widget)) &&
gtk_widget_get_visible (child))
+190 -610
View File
@@ -34,22 +34,10 @@
* the #GtkWidget:halign and #GtkWidget:valign properties can be used on
* the children to influence their allocation.
*
* GtkBox uses a notion of packing. Packing refers
* to adding widgets with reference to a particular position in a
* #GtkContainer. For a GtkBox, there are two reference positions: the
* start and the end of the box.
* For a vertical #GtkBox, the start is defined as the top of the box and
* the end is defined as the bottom. For a horizontal #GtkBox the start
* is defined as the left side and the end is defined as the right side.
*
* Use repeated calls to gtk_box_pack_start() to pack widgets into a
* GtkBox from start to end. Use gtk_box_pack_end() to add widgets from
* end to start. You may intersperse these calls and add widgets from
* both ends of the same GtkBox.
*
* Because GtkBox is a #GtkContainer, you may also use gtk_container_add()
* to insert widgets into the box. Use gtk_container_remove()
* to remove widgets from the GtkBox.
* Use repeated calls to gtk_container_add() to pack widgets into a
* GtkBox from start to end. Use gtk_container_remove() to remove widgets
* from the GtkBox. gtk_box_insert_child_after() can be used to add a child
* at a particular position.
*
* Use gtk_box_set_homogeneous() to specify whether or not all children
* of the GtkBox are forced to get the same amount of space.
@@ -58,7 +46,7 @@
* minimally placed between all children in the GtkBox. Note that
* spacing is added between the children.
*
* Use gtk_box_reorder_child() to move a GtkBox child to a different
* Use gtk_box_reorder_child_after() to move a child to a different
* place in the box.
*
* # CSS nodes
@@ -70,7 +58,6 @@
#include "gtkbox.h"
#include "gtkboxprivate.h"
#include "gtkcssnodeprivate.h"
#include "gtkcsspositionvalueprivate.h"
#include "gtkintl.h"
#include "gtkorientable.h"
@@ -95,43 +82,16 @@ enum {
LAST_PROP = PROP_ORIENTATION
};
enum {
CHILD_PROP_0,
CHILD_PROP_PACK_TYPE,
CHILD_PROP_POSITION,
LAST_CHILD_PROP
};
typedef struct _GtkBoxChild GtkBoxChild;
struct _GtkBoxPrivate
typedef struct
{
GList *children;
GtkOrientation orientation;
gint16 spacing;
guint homogeneous : 1;
guint baseline_pos : 2;
};
typedef struct _GtkBoxPrivate GtkBoxPrivate;
} GtkBoxPrivate;
static GParamSpec *props[LAST_PROP] = { NULL, };
static GParamSpec *child_props[LAST_CHILD_PROP] = { NULL, };
/*
* GtkBoxChild:
* @widget: the child widget, packed into the GtkBox.
* neighbors, set when packed, zero by default.
* @pack: one of #GtkPackType indicating whether the child is packed with
* reference to the start (top/left) or end (bottom/right) of the GtkBox.
*/
struct _GtkBoxChild
{
GtkWidget *widget;
guint pack : 1;
};
static void gtk_box_size_allocate (GtkWidget *widget,
int width,
@@ -153,16 +113,6 @@ static void gtk_box_remove (GtkContainer *container,
static void gtk_box_forall (GtkContainer *container,
GtkCallback callback,
gpointer callback_data);
static void gtk_box_set_child_property (GtkContainer *container,
GtkWidget *child,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gtk_box_get_child_property (GtkContainer *container,
GtkWidget *child,
guint property_id,
GValue *value,
GParamSpec *pspec);
static GType gtk_box_child_type (GtkContainer *container);
static GtkWidgetPath * gtk_box_get_path_for_child
(GtkContainer *container,
@@ -196,8 +146,6 @@ gtk_box_class_init (GtkBoxClass *class)
container_class->remove = gtk_box_remove;
container_class->forall = gtk_box_forall;
container_class->child_type = gtk_box_child_type;
container_class->set_child_property = gtk_box_set_child_property;
container_class->get_child_property = gtk_box_get_child_property;
container_class->get_path_for_child = gtk_box_get_path_for_child;
g_object_class_override_property (object_class,
@@ -228,23 +176,6 @@ gtk_box_class_init (GtkBoxClass *class)
g_object_class_install_properties (object_class, LAST_PROP, props);
child_props[CHILD_PROP_PACK_TYPE] =
g_param_spec_enum ("pack-type",
P_("Pack type"),
P_("A GtkPackType indicating whether the child is packed with reference to the start or end of the parent"),
GTK_TYPE_PACK_TYPE, GTK_PACK_START,
GTK_PARAM_READWRITE);
child_props[CHILD_PROP_POSITION] =
g_param_spec_int ("position",
P_("Position"),
P_("The index of the child in the parent"),
-1, G_MAXINT,
0,
GTK_PARAM_READWRITE);
gtk_container_class_install_child_properties (container_class, LAST_CHILD_PROP, child_props);
gtk_widget_class_set_accessible_role (widget_class, ATK_ROLE_FILLER);
gtk_widget_class_set_css_name (widget_class, I_("box"));
}
@@ -364,11 +295,9 @@ gtk_box_size_allocate (GtkWidget *widget,
{
GtkBox *box = GTK_BOX (widget);
GtkBoxPrivate *priv = gtk_box_get_instance_private (box);
GtkBoxChild *child;
GList *children;
GtkWidget *child;
gint nvis_children;
gint nexpand_children;
GtkTextDirection direction;
GtkAllocation child_allocation;
GtkRequestedSize *sizes;
@@ -376,9 +305,6 @@ gtk_box_size_allocate (GtkWidget *widget,
gint minimum_above, natural_above;
gint minimum_below, natural_below;
gboolean have_baseline;
GtkPackType packing;
gint extra_space;
gint children_minimum_size = 0;
gint size_given_to_child;
@@ -408,14 +334,14 @@ gtk_box_size_allocate (GtkWidget *widget,
minimum_below = natural_below = 0;
/* Retrieve desired size for visible children. */
for (i = 0, children = priv->children; children; children = children->next)
for (i = 0, child = _gtk_widget_get_first_child (widget);
child != NULL;
child = _gtk_widget_get_next_sibling (child))
{
child = children->data;
if (!_gtk_widget_get_visible (child->widget))
if (!_gtk_widget_get_visible (child))
continue;
gtk_widget_measure (child->widget,
gtk_widget_measure (child,
priv->orientation,
priv->orientation == GTK_ORIENTATION_HORIZONTAL ? height : width,
&sizes[i].minimum_size, &sizes[i].natural_size,
@@ -459,83 +385,69 @@ gtk_box_size_allocate (GtkWidget *widget,
}
/* Allocate child sizes. */
for (packing = GTK_PACK_START; packing <= GTK_PACK_END; ++packing)
for (i = 0, child = _gtk_widget_get_first_child (widget);
child != NULL;
child = _gtk_widget_get_next_sibling (child))
{
for (i = 0, children = priv->children;
children;
children = children->next)
{
child = children->data;
/* If widget is not visible, skip it. */
if (!_gtk_widget_get_visible (child))
continue;
/* If widget is not visible, skip it. */
if (!_gtk_widget_get_visible (child->widget))
continue;
/* Assign the child's size. */
if (priv->homogeneous)
{
child_size = size_given_to_child;
/* If widget is packed differently skip it, but still increment i,
* since widget is visible and will be handled in next loop iteration.
*/
if (child->pack != packing)
{
i++;
continue;
}
if (n_extra_widgets > 0)
{
child_size++;
n_extra_widgets--;
}
}
else
{
child_size = sizes[i].minimum_size;
/* Assign the child's size. */
if (priv->homogeneous)
{
child_size = size_given_to_child;
if (gtk_widget_compute_expand (child, priv->orientation))
{
child_size += size_given_to_child;
if (n_extra_widgets > 0)
{
child_size++;
n_extra_widgets--;
}
}
else
{
child_size = sizes[i].minimum_size;
if (n_extra_widgets > 0)
{
child_size++;
n_extra_widgets--;
}
}
}
if (gtk_widget_compute_expand (child->widget, priv->orientation))
{
child_size += size_given_to_child;
sizes[i].natural_size = child_size;
if (n_extra_widgets > 0)
{
child_size++;
n_extra_widgets--;
}
}
}
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL &&
gtk_widget_get_valign (child) == GTK_ALIGN_BASELINE)
{
int child_allocation_width;
int child_minimum_height, child_natural_height;
sizes[i].natural_size = child_size;
child_allocation_width = child_size;
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL &&
gtk_widget_get_valign (child->widget) == GTK_ALIGN_BASELINE)
{
int child_allocation_width;
int child_minimum_height, child_natural_height;
child_minimum_baseline = -1;
child_natural_baseline = -1;
gtk_widget_measure (child, GTK_ORIENTATION_VERTICAL,
child_allocation_width,
&child_minimum_height, &child_natural_height,
&child_minimum_baseline, &child_natural_baseline);
child_allocation_width = child_size;
if (child_minimum_baseline >= 0)
{
have_baseline = TRUE;
minimum_below = MAX (minimum_below, child_minimum_height - child_minimum_baseline);
natural_below = MAX (natural_below, child_natural_height - child_natural_baseline);
minimum_above = MAX (minimum_above, child_minimum_baseline);
natural_above = MAX (natural_above, child_natural_baseline);
}
}
child_minimum_baseline = -1;
child_natural_baseline = -1;
gtk_widget_measure (child->widget, GTK_ORIENTATION_VERTICAL,
child_allocation_width,
&child_minimum_height, &child_natural_height,
&child_minimum_baseline, &child_natural_baseline);
if (child_minimum_baseline >= 0)
{
have_baseline = TRUE;
minimum_below = MAX (minimum_below, child_minimum_height - child_minimum_baseline);
natural_below = MAX (natural_below, child_natural_height - child_natural_baseline);
minimum_above = MAX (minimum_above, child_minimum_baseline);
natural_above = MAX (natural_above, child_natural_baseline);
}
}
i++;
}
i++;
}
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
@@ -565,89 +477,52 @@ gtk_box_size_allocate (GtkWidget *widget,
}
/* Allocate child positions. */
for (packing = GTK_PACK_START; packing <= GTK_PACK_END; ++packing)
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
{
child_allocation.y = 0;
child_allocation.height = height;
x = 0;
}
else
{
child_allocation.x = 0;
child_allocation.width = width;
y = 0;
}
for (i = 0, child = _gtk_widget_get_first_child (widget);
child != NULL;
child = _gtk_widget_get_next_sibling (child))
{
/* If widget is not visible, skip it. */
if (!_gtk_widget_get_visible (child))
continue;
child_size = sizes[i].natural_size;
/* Assign the child's position. */
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
{
child_allocation.y = 0;
child_allocation.height = height;
if (packing == GTK_PACK_START)
x = 0;
else
x = width;
}
else
{
child_allocation.x = 0;
child_allocation.width = width;
if (packing == GTK_PACK_START)
y = 0;
else
y = height;
}
{
child_allocation.width = child_size;
child_allocation.x = x;
for (i = 0, children = priv->children;
children;
children = children->next)
{
child = children->data;
x += child_size + spacing;
/* If widget is not visible, skip it. */
if (!_gtk_widget_get_visible (child->widget))
continue;
if (direction == GTK_TEXT_DIR_RTL)
child_allocation.x = width - child_allocation.x - child_allocation.width;
/* If widget is packed differently skip it, but still increment i,
* since widget is visible and will be handled in next loop iteration.
*/
if (child->pack != packing)
{
i++;
continue;
}
}
else /* (priv->orientation == GTK_ORIENTATION_VERTICAL) */
{
child_allocation.height = child_size;
child_allocation.y = y;
child_size = sizes[i].natural_size;
y += child_size + spacing;
}
/* Assign the child's position. */
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
{
child_allocation.width = child_size;
child_allocation.x = x;
gtk_widget_size_allocate (child, &child_allocation, baseline);
if (packing == GTK_PACK_START)
{
x += child_size + spacing;
}
else
{
x -= child_size + spacing;
child_allocation.x -= child_size;
}
if (direction == GTK_TEXT_DIR_RTL)
child_allocation.x = width - child_allocation.x - child_allocation.width;
}
else /* (priv->orientation == GTK_ORIENTATION_VERTICAL) */
{
child_allocation.height = child_size;
child_allocation.y = y;
if (packing == GTK_PACK_START)
{
y += child_size + spacing;
}
else
{
y -= child_size + spacing;
child_allocation.y -= child_size;
}
}
gtk_widget_size_allocate (child->widget, &child_allocation, baseline);
i++;
}
i++;
}
}
@@ -657,70 +532,6 @@ gtk_box_child_type (GtkContainer *container)
return GTK_TYPE_WIDGET;
}
static void
gtk_box_set_child_property (GtkContainer *container,
GtkWidget *child,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
switch (property_id)
{
case CHILD_PROP_PACK_TYPE:
gtk_box_set_child_packing (GTK_BOX (container),
child,
g_value_get_enum (value));
break;
case CHILD_PROP_POSITION:
gtk_box_reorder_child (GTK_BOX (container),
child,
g_value_get_int (value));
break;
default:
GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID (container, property_id, pspec);
break;
}
}
static void
gtk_box_get_child_property (GtkContainer *container,
GtkWidget *child,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
GtkPackType pack_type = 0;
GtkBoxPrivate *priv = gtk_box_get_instance_private (GTK_BOX (container));
GList *list;
switch (property_id)
{
guint i;
case CHILD_PROP_PACK_TYPE:
gtk_box_query_child_packing (GTK_BOX (container),
child,
&pack_type);
g_value_set_enum (value, pack_type);
break;
case CHILD_PROP_POSITION:
i = 0;
for (list = priv->children; list; list = list->next)
{
GtkBoxChild *child_entry;
child_entry = list->data;
if (child_entry->widget == child)
break;
i++;
}
g_value_set_int (value, list ? i : -1);
break;
default:
GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID (container, property_id, pspec);
break;
}
}
typedef struct _CountingData CountingData;
struct _CountingData {
GtkWidget *widget;
@@ -820,67 +631,6 @@ gtk_box_get_path_for_child (GtkContainer *container,
return path;
}
static void
gtk_box_update_child_css_position (GtkBox *box,
GtkBoxChild *child_info)
{
GtkBoxPrivate *priv = gtk_box_get_instance_private (box);
GtkBoxChild *prev;
gboolean reverse;
GList *l;
prev = NULL;
for (l = priv->children; l->data != child_info; l = l->next)
{
GtkBoxChild *cur = l->data;
if (cur->pack == child_info->pack)
prev = cur;
}
reverse = child_info->pack == GTK_PACK_END;
if (reverse)
gtk_css_node_insert_before (gtk_widget_get_css_node (GTK_WIDGET (box)),
gtk_widget_get_css_node (child_info->widget),
prev ? gtk_widget_get_css_node (prev->widget) : NULL);
else
gtk_css_node_insert_after (gtk_widget_get_css_node (GTK_WIDGET (box)),
gtk_widget_get_css_node (child_info->widget),
prev ? gtk_widget_get_css_node (prev->widget) : NULL);
}
static void
gtk_box_pack (GtkBox *box,
GtkWidget *child,
GtkPackType pack_type)
{
GtkContainer *container = GTK_CONTAINER (box);
GtkBoxPrivate *priv = gtk_box_get_instance_private (box);
GtkBoxChild *child_info;
g_return_if_fail (GTK_IS_BOX (box));
g_return_if_fail (GTK_IS_WIDGET (child));
g_return_if_fail (_gtk_widget_get_parent (child) == NULL);
child_info = g_new (GtkBoxChild, 1);
child_info->widget = child;
child_info->pack = pack_type;
priv->children = g_list_append (priv->children, child_info);
gtk_box_update_child_css_position (box, child_info);
gtk_widget_freeze_child_notify (child);
gtk_widget_set_parent (child, GTK_WIDGET (box));
if (pack_type != GTK_PACK_START)
gtk_container_child_notify_by_pspec (container, child, child_props[CHILD_PROP_PACK_TYPE]);
gtk_container_child_notify_by_pspec (container, child, child_props[CHILD_PROP_POSITION]);
gtk_widget_thaw_child_notify (child);
}
static void
gtk_box_compute_size_for_opposing_orientation (GtkBox *box,
int for_size,
@@ -1067,9 +817,9 @@ gtk_box_compute_size_for_orientation (GtkBox *box,
int required_size = 0, required_natural = 0;
int largest_child = 0, largest_natural = 0;
for (child = gtk_widget_get_first_child (GTK_WIDGET (box));
for (child = _gtk_widget_get_first_child (GTK_WIDGET (box));
child != NULL;
child = gtk_widget_get_next_sibling (child))
child = _gtk_widget_get_next_sibling (child))
{
if (_gtk_widget_get_visible (child))
{
@@ -1134,8 +884,6 @@ gtk_box_init (GtkBox *box)
gtk_widget_set_has_surface (GTK_WIDGET (box), FALSE);
priv->orientation = GTK_ORIENTATION_HORIZONTAL;
priv->children = NULL;
priv->homogeneous = FALSE;
priv->spacing = 0;
priv->baseline_pos = GTK_BASELINE_POSITION_CENTER;
@@ -1162,38 +910,6 @@ gtk_box_new (GtkOrientation orientation,
NULL);
}
/**
* gtk_box_pack_start:
* @box: a #GtkBox
* @child: the #GtkWidget to be added to @box
*
* Adds @child to @box, packed with reference to the start of @box.
* The @child is packed after any other child packed with reference
* to the start of @box.
*/
void
gtk_box_pack_start (GtkBox *box,
GtkWidget *child)
{
gtk_box_pack (box, child, GTK_PACK_START);
}
/**
* gtk_box_pack_end:
* @box: a #GtkBox
* @child: the #GtkWidget to be added to @box
*
* Adds @child to @box, packed with reference to the end of @box.
* The @child is packed after (away from end of) any other child
* packed with reference to the end of @box.
*/
void
gtk_box_pack_end (GtkBox *box,
GtkWidget *child)
{
gtk_box_pack (box, child, GTK_PACK_END);
}
/**
* gtk_box_set_homogeneous:
* @box: a #GtkBox
@@ -1332,205 +1048,18 @@ gtk_box_get_baseline_position (GtkBox *box)
return priv->baseline_pos;
}
/**
* gtk_box_reorder_child:
* @box: a #GtkBox
* @child: the #GtkWidget to move
* @position: the new position for @child in the list of children
* of @box, starting from 0. If negative, indicates the end of
* the list
*
* Moves @child to a new @position in the list of @box children.
* The list contains widgets packed #GTK_PACK_START
* as well as widgets packed #GTK_PACK_END, in the order that these
* widgets were added to @box.
*
* A widgets position in the @box children list determines where
* the widget is packed into @box. A child widget at some position
* in the list will be packed just after all other widgets of the
* same packing type that appear earlier in the list.
*/
void
gtk_box_reorder_child (GtkBox *box,
GtkWidget *child,
gint position)
{
GtkBoxPrivate *priv = gtk_box_get_instance_private (box);
GList *old_link;
GList *new_link;
GtkBoxChild *child_info = NULL;
gint old_position;
g_return_if_fail (GTK_IS_BOX (box));
g_return_if_fail (GTK_IS_WIDGET (child));
old_link = priv->children;
old_position = 0;
while (old_link)
{
child_info = old_link->data;
if (child_info->widget == child)
break;
old_link = old_link->next;
old_position++;
}
g_return_if_fail (old_link != NULL);
if (position == old_position)
return;
priv->children = g_list_delete_link (priv->children, old_link);
if (position < 0)
new_link = NULL;
else
new_link = g_list_nth (priv->children, position);
priv->children = g_list_insert_before (priv->children, new_link, child_info);
gtk_box_update_child_css_position (box, child_info);
gtk_container_child_notify_by_pspec (GTK_CONTAINER (box), child, child_props[CHILD_PROP_POSITION]);
if (_gtk_widget_get_visible (child) &&
_gtk_widget_get_visible (GTK_WIDGET (box)))
{
gtk_widget_queue_resize (child);
}
}
/**
* gtk_box_query_child_packing:
* @box: a #GtkBox
* @child: the #GtkWidget of the child to query
* @pack_type: (out) (optional): pointer to return location for pack-type
* child property
*
* Obtains information about how @child is packed into @box.
*/
void
gtk_box_query_child_packing (GtkBox *box,
GtkWidget *child,
GtkPackType *pack_type)
{
GtkBoxPrivate *priv = gtk_box_get_instance_private (box);
GList *list;
GtkBoxChild *child_info = NULL;
g_return_if_fail (GTK_IS_BOX (box));
g_return_if_fail (GTK_IS_WIDGET (child));
list = priv->children;
while (list)
{
child_info = list->data;
if (child_info->widget == child)
break;
list = list->next;
}
if (list)
{
if (pack_type)
*pack_type = child_info->pack;
}
}
/**
* gtk_box_set_child_packing:
* @box: a #GtkBox
* @child: the #GtkWidget of the child to set
* @pack_type: the new value of the pack-type child property
*
* Sets the way @child is packed into @box.
*/
void
gtk_box_set_child_packing (GtkBox *box,
GtkWidget *child,
GtkPackType pack_type)
{
GtkBoxPrivate *priv = gtk_box_get_instance_private (box);
GList *list;
GtkBoxChild *child_info = NULL;
g_return_if_fail (GTK_IS_BOX (box));
g_return_if_fail (GTK_IS_WIDGET (child));
list = priv->children;
while (list)
{
child_info = list->data;
if (child_info->widget == child)
break;
list = list->next;
}
gtk_widget_freeze_child_notify (child);
if (list)
{
if (pack_type != GTK_PACK_END)
pack_type = GTK_PACK_START;
if (child_info->pack != pack_type)
{
child_info->pack = pack_type;
gtk_box_update_child_css_position (box, child_info);
gtk_container_child_notify_by_pspec (GTK_CONTAINER (box), child, child_props[CHILD_PROP_PACK_TYPE]);
}
if (_gtk_widget_get_visible (child) &&
_gtk_widget_get_visible (GTK_WIDGET (box)))
gtk_widget_queue_resize (child);
}
gtk_widget_thaw_child_notify (child);
}
static void
gtk_box_add (GtkContainer *container,
GtkWidget *widget)
GtkWidget *child)
{
gtk_box_pack_start (GTK_BOX (container), widget);
gtk_widget_set_parent (child, GTK_WIDGET (container));
}
static void
gtk_box_remove (GtkContainer *container,
GtkWidget *widget)
{
GtkBox *box = GTK_BOX (container);
GtkBoxPrivate *priv = gtk_box_get_instance_private (box);
GtkBoxChild *child;
GList *children;
children = priv->children;
while (children)
{
child = children->data;
if (child->widget == widget)
{
gboolean was_visible;
was_visible = _gtk_widget_get_visible (widget);
gtk_widget_unparent (widget);
priv->children = g_list_remove_link (priv->children, children);
g_list_free (children);
g_free (child);
/* queue resize regardless of gtk_widget_get_visible (container),
* since that's what is needed by toplevels.
*/
if (was_visible)
{
gtk_widget_queue_resize (GTK_WIDGET (container));
}
break;
}
children = children->next;
}
gtk_widget_unparent (widget);
}
static void
@@ -1538,51 +1067,102 @@ gtk_box_forall (GtkContainer *container,
GtkCallback callback,
gpointer callback_data)
{
GtkBox *box = GTK_BOX (container);
GtkBoxPrivate *priv = gtk_box_get_instance_private (box);
GtkBoxChild *child;
GList *children;
GtkWidget *child;
children = priv->children;
while (children)
child = _gtk_widget_get_first_child (GTK_WIDGET (container));
while (child)
{
child = children->data;
children = children->next;
GtkWidget *next = _gtk_widget_get_next_sibling (child);
if (child->pack == GTK_PACK_START)
(* callback) (child->widget, callback_data);
(* callback) (child, callback_data);
child = next;
}
children = g_list_last (priv->children);
while (children)
{
child = children->data;
children = children->prev;
if (child->pack == GTK_PACK_END)
(* callback) (child->widget, callback_data);
}
}
GList *
_gtk_box_get_children (GtkBox *box)
{
GtkBoxPrivate *priv = gtk_box_get_instance_private (box);
GtkBoxChild *child;
GList *children;
GtkWidget *p;
GList *retval = NULL;
g_return_val_if_fail (GTK_IS_BOX (box), NULL);
children = priv->children;
while (children)
{
child = children->data;
children = children->next;
retval = g_list_prepend (retval, child->widget);
}
for (p = _gtk_widget_get_first_child (GTK_WIDGET (box));
p != NULL;
p = _gtk_widget_get_next_sibling (p))
retval = g_list_prepend (retval, p);
return g_list_reverse (retval);
}
/**
* gtk_box_insert_child_after:
* @box: a #GtkBox
* @child: the #GtkWidget to insert
* @sibling: (nullable): the sibling to move @child after, or %NULL
*
* Inserts @child in the position after @sibling in the list
* of @box children. If @sibling is %NULL, insert @child at
* the first position.
*/
void
gtk_box_insert_child_after (GtkBox *box,
GtkWidget *child,
GtkWidget *sibling)
{
GtkWidget *widget = GTK_WIDGET (box);
g_return_if_fail (GTK_IS_BOX (box));
g_return_if_fail (GTK_IS_WIDGET (child));
g_return_if_fail (gtk_widget_get_parent (child) == NULL);
if (sibling)
{
g_return_if_fail (GTK_IS_WIDGET (sibling));
g_return_if_fail (gtk_widget_get_parent (sibling) == widget);
}
if (child == sibling)
return;
gtk_widget_insert_after (child, widget, sibling);
gtk_css_node_insert_after (gtk_widget_get_css_node (widget),
gtk_widget_get_css_node (child),
sibling ? gtk_widget_get_css_node (sibling) : NULL);
}
/**
* gtk_box_reorder_child_after:
* @box: a #GtkBox
* @child: the #GtkWidget to move, must be a child of @box
* @sibling: (nullable): the sibling to move @child after, or %NULL
*
* Moves @child to the position after @sibling in the list
* of @box children. If @sibling is %NULL, move @child to
* the first position.
*/
void
gtk_box_reorder_child_after (GtkBox *box,
GtkWidget *child,
GtkWidget *sibling)
{
GtkWidget *widget = GTK_WIDGET (box);
g_return_if_fail (GTK_IS_BOX (box));
g_return_if_fail (GTK_IS_WIDGET (child));
g_return_if_fail (gtk_widget_get_parent (child) == widget);
if (sibling)
{
g_return_if_fail (GTK_IS_WIDGET (sibling));
g_return_if_fail (gtk_widget_get_parent (sibling) == widget);
}
if (child == sibling)
return;
gtk_widget_insert_after (child, widget, sibling);
gtk_css_node_insert_after (gtk_widget_get_css_node (widget),
gtk_widget_get_css_node (child),
sibling ? gtk_widget_get_css_node (sibling) : NULL);
}
+6 -17
View File
@@ -75,14 +75,6 @@ GType gtk_box_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GtkWidget* gtk_box_new (GtkOrientation orientation,
gint spacing);
GDK_AVAILABLE_IN_ALL
void gtk_box_pack_start (GtkBox *box,
GtkWidget *child);
GDK_AVAILABLE_IN_ALL
void gtk_box_pack_end (GtkBox *box,
GtkWidget *child);
GDK_AVAILABLE_IN_ALL
void gtk_box_set_homogeneous (GtkBox *box,
gboolean homogeneous);
@@ -100,18 +92,15 @@ GDK_AVAILABLE_IN_ALL
GtkBaselinePosition gtk_box_get_baseline_position (GtkBox *box);
GDK_AVAILABLE_IN_ALL
void gtk_box_reorder_child (GtkBox *box,
GtkWidget *child,
gint position);
void gtk_box_insert_child_after (GtkBox *box,
GtkWidget *child,
GtkWidget *sibling);
GDK_AVAILABLE_IN_ALL
void gtk_box_query_child_packing (GtkBox *box,
void gtk_box_reorder_child_after (GtkBox *box,
GtkWidget *child,
GtkPackType *pack_type);
GDK_AVAILABLE_IN_ALL
void gtk_box_set_child_packing (GtkBox *box,
GtkWidget *child,
GtkPackType pack_type);
GtkWidget *sibling);
G_END_DECLS
+6 -7
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");
@@ -745,8 +745,7 @@ add_custom_color (GtkColorChooserWidget *cc,
gtk_color_swatch_set_can_drop (GTK_COLOR_SWATCH (p), TRUE);
connect_custom_signals (p, cc);
gtk_container_add (GTK_CONTAINER (cc->priv->custom), p);
gtk_box_reorder_child (GTK_BOX (cc->priv->custom), p, 1);
gtk_box_insert_child_after (GTK_BOX (cc->priv->custom), p, gtk_widget_get_first_child (cc->priv->custom));
gtk_widget_show (p);
select_swatch (cc, GTK_COLOR_SWATCH (p));
+2 -3
View File
@@ -1156,8 +1156,7 @@ gtk_combo_box_create_child (GtkComboBox *combo_box)
gtk_widget_set_hexpand (child, TRUE);
gtk_cell_view_set_fit_model (GTK_CELL_VIEW (priv->cell_view), TRUE);
gtk_cell_view_set_model (GTK_CELL_VIEW (priv->cell_view), priv->model);
gtk_container_add (GTK_CONTAINER (gtk_widget_get_parent (priv->arrow)),
priv->cell_view);
gtk_box_insert_child_after (GTK_BOX (gtk_widget_get_parent (priv->arrow)), priv->cell_view, NULL);
_gtk_bin_set_child (GTK_BIN (combo_box), priv->cell_view);
}
}
@@ -1192,7 +1191,7 @@ gtk_combo_box_add (GtkContainer *container,
}
gtk_widget_set_hexpand (widget, TRUE);
gtk_container_add (GTK_CONTAINER (priv->box), widget);
gtk_box_insert_child_after (GTK_BOX (priv->box), widget, NULL);
_gtk_bin_set_child (GTK_BIN (container), widget);
if (priv->has_entry)
+5 -5
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
+12 -12
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);
+6 -6
View File
@@ -133,8 +133,8 @@
* # GtkDialog as GtkBuildable
*
* The GtkDialog implementation of the #GtkBuildable interface exposes the
* @vbox and @action_area as internal children with the names vbox and
* action_area.
* @message_area and @action_area as internal children with the names
* action_area and action_area.
*
* GtkDialog supports a custom <action-widgets> element, which can contain
* multiple <action-widget> elements. The response attribute specifies a
@@ -170,9 +170,9 @@
typedef struct
{
GtkWidget *vbox;
GtkWidget *headerbar;
GtkWidget *action_area;
GtkWidget *content_area;
GtkWidget *action_box;
GtkSizeGroup *size_group;
@@ -592,9 +592,9 @@ gtk_dialog_class_init (GtkDialogClass *class)
/* Bind class to template
*/
gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/libgtk/ui/gtkdialog.ui");
gtk_widget_class_bind_template_child_internal_private (widget_class, GtkDialog, vbox);
gtk_widget_class_bind_template_child_internal_private (widget_class, GtkDialog, headerbar);
gtk_widget_class_bind_template_child_internal_private (widget_class, GtkDialog, action_area);
gtk_widget_class_bind_template_child_internal_private (widget_class, GtkDialog, content_area);
gtk_widget_class_bind_template_child_private (widget_class, GtkDialog, action_box);
gtk_widget_class_set_css_name (widget_class, I_("dialog"));
@@ -727,7 +727,7 @@ gtk_dialog_close (GtkDialog *dialog)
* Creates a new dialog box.
*
* Widgets should not be packed into this #GtkWindow
* directly, but into the @vbox and @action_area, as described above.
* directly, but into the @content_area and @action_area, as described above.
*
* Returns: the new dialog as a #GtkWidget
*/
@@ -1621,5 +1621,5 @@ gtk_dialog_get_content_area (GtkDialog *dialog)
g_return_val_if_fail (GTK_IS_DIALOG (dialog), NULL);
return priv->vbox;
return priv->content_area;
}
+2 -2
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);
+1 -1
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);
}
+5 -10
View File
@@ -916,8 +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_box_reorder_child (GTK_BOX (priv->preview_box), priv->preview_label, 0);
gtk_box_insert_child_after (GTK_BOX (priv->preview_box), priv->preview_label, NULL);
gtk_label_set_ellipsize (GTK_LABEL (priv->preview_label), PANGO_ELLIPSIZE_MIDDLE);
gtk_widget_show (priv->preview_label);
}
@@ -957,10 +956,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_box_reorder_child (GTK_BOX (priv->preview_box),
priv->preview_widget,
(priv->use_preview_label && priv->preview_label) ? 1 : 0);
gtk_container_add (GTK_CONTAINER (priv->preview_box), priv->preview_widget);
}
update_preview_widget_visibility (impl);
@@ -2587,7 +2583,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,8 +2603,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_box_reorder_child (GTK_BOX (priv->box), priv->save_widgets, 0);
gtk_box_insert_child_after (GTK_BOX (priv->box), priv->save_widgets, NULL);
gtk_widget_show (priv->save_widgets);
}
@@ -2675,7 +2670,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);
+7 -7
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,9 +468,9 @@ _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);
gtk_box_reorder_child_after (GTK_BOX (box), separator, NULL);
if (i == 0)
gtk_style_context_add_class (gtk_widget_get_style_context (box), GTK_STYLE_CLASS_LEFT);
+2 -1
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);
+17 -7
View File
@@ -134,7 +134,7 @@ gtk_menu_section_box_sync_separators (GtkMenuSectionBox *box,
return;
if (should_have_separator)
gtk_box_pack_start (GTK_BOX (box), box->separator);
gtk_box_insert_child_after (GTK_BOX (box), box->separator, NULL);
else
gtk_container_remove (GTK_CONTAINER (box), box->separator);
}
@@ -330,7 +330,17 @@ gtk_menu_section_box_insert_func (GtkMenuTrackerItem *item,
gtk_widget_set_halign (widget, GTK_ALIGN_FILL);
gtk_container_add (GTK_CONTAINER (box->item_box), widget);
gtk_box_reorder_child (GTK_BOX (box->item_box), widget, position);
if (position == 0)
gtk_box_reorder_child_after (GTK_BOX (box->item_box), widget, NULL);
else
{
GtkWidget *sibling = gtk_widget_get_first_child (GTK_WIDGET (box->item_box));
int i;
for (i = 1; i < position; i++)
sibling = gtk_widget_get_next_sibling (sibling);
gtk_box_reorder_child_after (GTK_BOX (box->item_box), widget, sibling);
}
gtk_menu_section_box_schedule_separator_sync (box);
}
@@ -346,7 +356,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 +464,7 @@ 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_box_insert_child_after (GTK_BOX (box), button, NULL);
g_signal_connect (focus, "clicked", G_CALLBACK (open_submenu), item);
g_signal_connect (button, "clicked", G_CALLBACK (close_submenu), item);
@@ -515,17 +525,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
{
+2 -2
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);
+1 -2
View File
@@ -191,8 +191,7 @@ gtk_model_menu_item_set_icon (GtkModelMenuItem *item,
image = gtk_image_new_from_gicon (icon);
gtk_image_set_pixel_size (GTK_IMAGE (image), 16);
gtk_container_add (GTK_CONTAINER (child), image);
gtk_box_reorder_child (GTK_BOX (child), image, 0);
gtk_box_insert_child_after (GTK_BOX (child), image, NULL);
}
g_object_notify (G_OBJECT (item), "icon");
+14 -14
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),
+8 -7
View File
@@ -6206,7 +6206,7 @@ gtk_notebook_update_tab_pos (GtkNotebook *notebook)
gtk_widget_set_hexpand (priv->header_widget, TRUE);
gtk_widget_set_vexpand (priv->header_widget, FALSE);
if (priv->show_tabs)
gtk_box_reorder_child (GTK_BOX (priv->box), priv->header_widget, 0);
gtk_box_reorder_child_after (GTK_BOX (priv->box), priv->header_widget, NULL);
gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->box), GTK_ORIENTATION_VERTICAL);
gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->header_widget), GTK_ORIENTATION_HORIZONTAL);
@@ -6218,7 +6218,7 @@ gtk_notebook_update_tab_pos (GtkNotebook *notebook)
gtk_widget_set_hexpand (priv->header_widget, TRUE);
gtk_widget_set_vexpand (priv->header_widget, FALSE);
if (priv->show_tabs)
gtk_box_reorder_child (GTK_BOX (priv->box), priv->header_widget, 1);
gtk_box_reorder_child_after (GTK_BOX (priv->box), priv->header_widget, gtk_widget_get_last_child (priv->box));
gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->box), GTK_ORIENTATION_VERTICAL);
gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->header_widget), GTK_ORIENTATION_HORIZONTAL);
@@ -6230,7 +6230,7 @@ gtk_notebook_update_tab_pos (GtkNotebook *notebook)
gtk_widget_set_hexpand (priv->header_widget, FALSE);
gtk_widget_set_vexpand (priv->header_widget, TRUE);
if (priv->show_tabs)
gtk_box_reorder_child (GTK_BOX (priv->box), priv->header_widget, 0);
gtk_box_reorder_child_after (GTK_BOX (priv->box), priv->header_widget, NULL);
gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->box), GTK_ORIENTATION_HORIZONTAL);
gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->header_widget), GTK_ORIENTATION_VERTICAL);
@@ -6242,7 +6242,7 @@ gtk_notebook_update_tab_pos (GtkNotebook *notebook)
gtk_widget_set_hexpand (priv->header_widget, FALSE);
gtk_widget_set_vexpand (priv->header_widget, TRUE);
if (priv->show_tabs)
gtk_box_reorder_child (GTK_BOX (priv->box), priv->header_widget, 1);
gtk_box_reorder_child_after (GTK_BOX (priv->box), priv->header_widget, gtk_widget_get_last_child (priv->box));
gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->box), GTK_ORIENTATION_HORIZONTAL);
gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->header_widget), GTK_ORIENTATION_VERTICAL);
@@ -7149,10 +7149,11 @@ gtk_notebook_set_action_widget (GtkNotebook *notebook,
if (widget)
{
int pos = pack_type == GTK_PACK_START ? 0 : -1;
gtk_container_add (GTK_CONTAINER (priv->header_widget), widget);
gtk_box_reorder_child (GTK_BOX (priv->header_widget), widget, pos);
if (pack_type == GTK_PACK_START)
gtk_box_reorder_child_after (GTK_BOX (priv->header_widget), widget, NULL);
else
gtk_box_reorder_child_after (GTK_BOX (priv->header_widget), widget, gtk_widget_get_last_child (priv->header_widget));
gtk_widget_set_child_visible (widget, priv->show_tabs);
}
+2 -2
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:
+8 -8
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));
+9 -9
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);
}
/*
+7 -7
View File
@@ -1294,13 +1294,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);
@@ -1345,14 +1345,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
@@ -1630,7 +1630,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);
}
}
+2 -2
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;
+11 -12
View File
@@ -724,18 +724,17 @@ apply_orientation (GtkScaleButton *button,
{
priv->applied_orientation = orientation;
gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->box), orientation);
gtk_container_child_set (GTK_CONTAINER (priv->box),
priv->plus_button,
"pack-type",
orientation == GTK_ORIENTATION_VERTICAL ?
GTK_PACK_START : GTK_PACK_END,
NULL);
gtk_container_child_set (GTK_CONTAINER (priv->box),
priv->minus_button,
"pack-type",
orientation == GTK_ORIENTATION_VERTICAL ?
GTK_PACK_END : GTK_PACK_START,
NULL);
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
gtk_box_reorder_child_after (GTK_BOX (priv->box), priv->plus_button, NULL);
gtk_box_reorder_child_after (GTK_BOX (priv->box), priv->scale, NULL);
}
else
{
gtk_box_reorder_child_after (GTK_BOX (priv->box), priv->scale, NULL);
gtk_box_reorder_child_after (GTK_BOX (priv->box), priv->plus_button, NULL);
}
gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->scale), orientation);
+4 -3
View File
@@ -34,6 +34,7 @@
#include "gtkmarshalers.h"
#include "gtkgesturepan.h"
#include "gtkwidgetprivate.h"
#include "gtkcenterbox.h"
#include "gtkintl.h"
/**
@@ -444,13 +445,13 @@ gtk_shortcuts_section_init (GtkShortcutsSection *self)
g_signal_connect_swapped (self->show_all, "clicked",
G_CALLBACK (gtk_shortcuts_section_show_all), self);
self->footer = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 20);
self->footer = gtk_center_box_new ();
GTK_CONTAINER_CLASS (gtk_shortcuts_section_parent_class)->add (GTK_CONTAINER (self), self->footer);
gtk_widget_set_hexpand (GTK_WIDGET (self->switcher), TRUE);
gtk_widget_set_halign (GTK_WIDGET (self->switcher), GTK_ALIGN_CENTER);
gtk_container_add (GTK_CONTAINER (self->footer), GTK_WIDGET (self->switcher));
gtk_box_pack_end (GTK_BOX (self->footer), self->show_all);
gtk_center_box_set_center_widget (GTK_CENTER_BOX (self->footer), GTK_WIDGET (self->switcher));
gtk_center_box_set_end_widget (GTK_CENTER_BOX (self->footer), self->show_all);
gtk_widget_set_halign (self->show_all, GTK_ALIGN_END);
gesture = gtk_gesture_pan_new (GTK_ORIENTATION_HORIZONTAL);
+5 -3
View File
@@ -865,6 +865,7 @@ gtk_spin_button_init (GtkSpinButton *spin_button)
priv->box = gtk_box_new (priv->orientation, 0);
gtk_widget_set_parent (priv->box, GTK_WIDGET (spin_button));
priv->entry = gtk_entry_new ();
gtk_entry_set_width_chars (GTK_ENTRY (priv->entry), 0);
gtk_entry_set_max_width_chars (GTK_ENTRY (priv->entry), 0);
@@ -1039,13 +1040,14 @@ gtk_spin_button_set_orientation (GtkSpinButton *spin,
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
{
/* Current orientation of the box is vertical! */
gtk_box_reorder_child (GTK_BOX (priv->box), priv->entry, 0);
gtk_box_reorder_child (GTK_BOX (priv->box), priv->down_button, 1);
gtk_box_reorder_child_after (GTK_BOX (priv->box), priv->up_button, NULL);
gtk_box_reorder_child_after (GTK_BOX (priv->box), priv->entry, NULL);
}
else
{
/* Current orientation of the box is horizontal! */
gtk_box_reorder_child (GTK_BOX (priv->box), priv->up_button, 0);
gtk_box_reorder_child_after (GTK_BOX (priv->box), priv->entry, NULL);
gtk_box_reorder_child_after (GTK_BOX (priv->box), priv->up_button, NULL);
}
gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->box), priv->orientation);
+10 -1
View File
@@ -235,7 +235,16 @@ on_position_updated (GtkWidget *widget,
"position", &position,
NULL);
gtk_box_reorder_child (GTK_BOX (self), button, position);
if (position == 0)
gtk_box_reorder_child_after (GTK_BOX (self), button, NULL);
else
{
GtkWidget *sibling = gtk_widget_get_first_child (GTK_WIDGET (self));
int i;
for (i = 1; i < position; i++)
sibling = gtk_widget_get_next_sibling (sibling);
gtk_box_reorder_child_after (GTK_BOX (self), button, sibling);
}
}
static void
+8 -6
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");
+6 -6
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);
@@ -964,9 +964,9 @@ gtk_tree_view_column_update_button (GtkTreeViewColumn *tree_column)
* reverse things
*/
if (priv->xalign <= 0.5)
gtk_box_reorder_child (GTK_BOX (hbox), arrow, 1);
gtk_box_reorder_child_after (GTK_BOX (hbox), arrow, gtk_widget_get_last_child (hbox));
else
gtk_box_reorder_child (GTK_BOX (hbox), arrow, 0);
gtk_box_reorder_child_after (GTK_BOX (hbox), arrow, NULL);
if (priv->show_sort_indicator
|| (GTK_IS_TREE_SORTABLE (model) && priv->sort_column_id >= 0))
+4 -4
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);
+3 -4
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))
{
+4 -4
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
+2 -3
View File
@@ -31,6 +31,8 @@
<property name="icon-name">insert-object-symbolic</property>
<property name="tooltip-text" translatable="yes">Add debug nodes</property>
<property name="active" bind-source="GtkInspectorRecorder" bind-property="debug-nodes" bind-flags="bidirectional|sync-create"/>
<property name="halign">start</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
@@ -41,9 +43,6 @@
<property name="tooltip-text" translatable="yes">Save selected node</property>
<signal name="clicked" handler="render_node_save"/>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
</object>
</child>
+2 -2
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);
+5 -5
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
+2 -11
View File
@@ -15,8 +15,8 @@
</child>
</object>
</child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<child internal-child="content_area">
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<property name="margin">5</property>
@@ -37,9 +37,6 @@
<property name="justify">center</property>
<property name="selectable">1</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkStack" id="stack">
@@ -224,14 +221,8 @@
</packing>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
+3 -4
View File
@@ -4,7 +4,7 @@
<template class="GtkAppChooserDialog" parent="GtkDialog">
<property name="title" translatable="yes">Select Application</property>
<property name="type-hint">dialog</property>
<child internal-child="vbox">
<child internal-child="content_area">
<object class="GtkBox" id="dialog-vbox1">
<property name="orientation">vertical</property>
<property name="spacing">2</property>
@@ -21,10 +21,9 @@
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1">
<property name="layout-style">end</property>
<property name="hexpand">1</property>
<property name="halign">end</property>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
<child>
<object class="GtkBox" id="inner_box">
+44 -73
View File
@@ -35,9 +35,9 @@
<property name="spacing">6</property>
<property name="margin">6</property>
<child>
<object class="GtkButton" id="apply">
<object class="GtkButton" id="close">
<property name="visible">0</property>
<property name="label" translatable="yes">_Apply</property>
<property name="label" translatable="yes">_Close</property>
<property name="can-focus">1</property>
<property name="can-default">1</property>
<property name="receives-default">1</property>
@@ -45,61 +45,8 @@
<style>
<class name="text-button"/>
</style>
<signal name="clicked" handler="on_assistant_apply" swapped="no"/>
<signal name="clicked" handler="on_assistant_close" swapped="no"/>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
<child>
<object class="GtkButton" id="forward">
<property name="label" translatable="yes">_Next</property>
<property name="can-focus">1</property>
<property name="can-default">1</property>
<property name="receives-default">1</property>
<property name="use-underline">1</property>
<style>
<class name="text-button"/>
</style>
<signal name="clicked" handler="on_assistant_forward" swapped="no"/>
</object>
<packing>
<property name="pack-type">end</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="back">
<property name="label" translatable="yes">_Back</property>
<property name="can-focus">1</property>
<property name="receives-default">1</property>
<property name="use-underline">1</property>
<style>
<class name="text-button"/>
</style>
<signal name="clicked" handler="on_assistant_back" swapped="no"/>
</object>
<packing>
<property name="pack-type">end</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="last">
<property name="visible">0</property>
<property name="label" translatable="yes">_Finish</property>
<property name="can-focus">1</property>
<property name="receives-default">1</property>
<property name="use-underline">1</property>
<style>
<class name="text-button"/>
</style>
<signal name="clicked" handler="on_assistant_last" swapped="no"/>
</object>
<packing>
<property name="pack-type">end</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkButton" id="cancel">
@@ -113,15 +60,35 @@
</style>
<signal name="clicked" handler="on_assistant_cancel" swapped="no"/>
</object>
<packing>
<property name="pack-type">end</property>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkButton" id="close">
<object class="GtkButton" id="last">
<property name="visible">0</property>
<property name="label" translatable="yes">_Close</property>
<property name="label" translatable="yes">_Finish</property>
<property name="can-focus">1</property>
<property name="receives-default">1</property>
<property name="use-underline">1</property>
<style>
<class name="text-button"/>
</style>
<signal name="clicked" handler="on_assistant_last" swapped="no"/>
</object>
</child>
<child>
<object class="GtkButton" id="back">
<property name="label" translatable="yes">_Back</property>
<property name="can-focus">1</property>
<property name="receives-default">1</property>
<property name="use-underline">1</property>
<style>
<class name="text-button"/>
</style>
<signal name="clicked" handler="on_assistant_back" swapped="no"/>
</object>
</child>
<child>
<object class="GtkButton" id="forward">
<property name="label" translatable="yes">_Next</property>
<property name="can-focus">1</property>
<property name="can-default">1</property>
<property name="receives-default">1</property>
@@ -129,22 +96,26 @@
<style>
<class name="text-button"/>
</style>
<signal name="clicked" handler="on_assistant_close" swapped="no"/>
<signal name="clicked" handler="on_assistant_forward" swapped="no"/>
</object>
</child>
<child>
<object class="GtkButton" id="apply">
<property name="visible">0</property>
<property name="label" translatable="yes">_Apply</property>
<property name="can-focus">1</property>
<property name="can-default">1</property>
<property name="receives-default">1</property>
<property name="use-underline">1</property>
<style>
<class name="text-button"/>
</style>
<signal name="clicked" handler="on_assistant_apply" swapped="no"/>
</object>
<packing>
<property name="pack-type">end</property>
<property name="position">5</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
+1 -4
View File
@@ -5,7 +5,7 @@
<property name="title" translatable="yes">Select a Color</property>
<property name="type-hint">dialog</property>
<property name="resizable">0</property>
<child internal-child="vbox">
<child internal-child="content_area">
<object class="GtkBox" id="dialog-vbox1">
<property name="orientation">vertical</property>
<property name="spacing">2</property>
@@ -20,9 +20,6 @@
<signal name="notify::rgba" handler="propagate_notify" swapped="no"/>
<signal name="notify::show-editor" handler="propagate_notify" swapped="no"/>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
-3
View File
@@ -135,9 +135,6 @@
</object>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
</template>
<object class="GtkBox" id="a_popup">
-6
View File
@@ -16,16 +16,10 @@
<object class="GtkIcon" id="arrow">
<property name="css-name">arrow</property>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
</object>
</child>
+9 -7
View File
@@ -10,11 +10,19 @@
</object>
</child>
<child>
<object class="GtkBox" id="vbox">
<object class="GtkBox">
<property name="orientation">vertical</property>
<style>
<class name="dialog-vbox"/>
</style>
<!-- This is empty here and just exists so we can expose it as
GtkDialog API. -->
<child>
<object class="GtkBox" id="content_area">
</object>
</child>
<child>
<object class="GtkBox" id="action_box">
<style>
@@ -28,14 +36,8 @@
<class name="dialog-action-area"/>
</style>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
</object>
</child>
+4 -8
View File
@@ -6,17 +6,16 @@
<property name="type-hint">dialog</property>
<property name="default-width">600</property>
<signal name="response" handler="response_cb" swapped="no"/>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<child internal-child="content_area">
<object class="GtkBox">
<property name="orientation">vertical</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1">
<property name="margin">6</property>
<property name="layout-style">end</property>
<property name="hexpand">1</property>
<property name="halign">end</property>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
<child>
<object class="GtkFileChooserWidget" id="widget">
@@ -26,9 +25,6 @@
<signal name="response-requested" handler="file_chooser_widget_response_requested" swapped="no"/>
<signal name="selection-changed" handler="file_chooser_widget_selection_changed" swapped="no"/>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
-23
View File
@@ -65,10 +65,6 @@
<property name="icon-name">folder-new-symbolic</property>
<signal name="notify::active" handler="new_folder_popover_active"/>
</object>
<packing>
<property name="pack-type">end</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
@@ -101,9 +97,6 @@
<object class="GtkSpinner" id="search_spinner">
<property name="visible">0</property>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
</object>
<packing>
@@ -326,14 +319,8 @@
<property name="orientation">vertical</property>
<property name="spacing">12</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
@@ -341,9 +328,6 @@
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
@@ -367,9 +351,6 @@
<property name="valign">start</property>
<signal name="changed" handler="filter_combo_changed" swapped="no"/>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
</object>
<packing>
@@ -377,10 +358,6 @@
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
<property name="pack-type">end</property>
</packing>
</child>
</object>
</child>
+1 -4
View File
@@ -4,7 +4,7 @@
<template class="GtkFontChooserDialog" parent="GtkDialog">
<property name="title" translatable="yes">Select Font</property>
<property name="type-hint">dialog</property>
<child internal-child="vbox">
<child internal-child="content_area">
<object class="GtkBox" id="dialog-vbox1">
<property name="orientation">vertical</property>
<property name="spacing">2</property>
@@ -14,9 +14,6 @@
<property name="vexpand">1</property>
<signal name="font-activated" handler="font_activated_cb" swapped="no"/>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
-6
View File
@@ -20,9 +20,6 @@
<property name="margin">6</property>
<property name="layout-style">end</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="close_button">
@@ -36,9 +33,6 @@
<class name="close"/>
</style>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
+1 -7
View File
@@ -9,7 +9,7 @@
<child internal-child="headerbar">
<object class="GtkHeaderBar" id="headerbar1"/>
</child>
<child internal-child="vbox">
<child internal-child="content_area">
<object class="GtkBox" id="dialog-vbox1">
<property name="orientation">vertical</property>
<property name="spacing">20</property>
@@ -41,14 +41,8 @@
<property name="wrap">1</property>
<property name="max-width-chars">60</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
+1 -13
View File
@@ -27,7 +27,7 @@
<property name="resizable">0</property>
<property name="type-hint">dialog</property>
<property name="title" translatable="yes">Page Setup</property>
<child internal-child="vbox">
<child internal-child="content_area">
<object class="GtkBox" id="dialog-vbox1">
<property name="orientation">vertical</property>
<property name="spacing">2</property>
@@ -139,9 +139,6 @@
<object class="GtkLabel" id="label1">
<property name="label" translatable="yes">Portrait</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
@@ -170,9 +167,6 @@
<object class="GtkLabel" id="label2">
<property name="label" translatable="yes">Reverse portrait</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
@@ -201,9 +195,6 @@
<object class="GtkLabel" id="label3">
<property name="label" translatable="yes">Landscape</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
@@ -231,9 +222,6 @@
<object class="GtkLabel" id="label4">
<property name="label" translatable="yes">Reverse landscape</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
-27
View File
@@ -43,9 +43,6 @@
<property name="max-width-chars">40</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
@@ -56,9 +53,6 @@
<property name="max-width-chars">40</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="available_protocols_grid">
@@ -94,9 +88,6 @@
</packing>
</child>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
</object>
</child>
@@ -126,9 +117,6 @@
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
@@ -168,9 +156,6 @@
</object>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
@@ -238,9 +223,6 @@
<attribute name="scale" value="1.44"/>
</attributes>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
@@ -249,9 +231,6 @@
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
@@ -259,9 +238,6 @@
</packing>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkActionBar" id="actionbar">
@@ -336,9 +312,6 @@
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</template>
</interface>
-12
View File
@@ -23,9 +23,6 @@
<property name="xalign">0</property>
<property name="ellipsize">end</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="available_space_label">
@@ -34,9 +31,6 @@
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="path_label">
@@ -48,9 +42,6 @@
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkStack" id="mount_stack">
@@ -78,9 +69,6 @@
</object>
</child>
</object>
<packing>
<property name="position">4</property>
</packing>
</child>
</object>
</child>
+1 -47
View File
@@ -51,7 +51,7 @@
<property name="type-hint">dialog</property>
<signal name="notify::page-setup" handler="redraw_page_layout_preview" swapped="no"/>
<signal name="response" handler="error_dialogs" swapped="no"/>
<child internal-child="vbox">
<child internal-child="content_area">
<object class="GtkBox" id="dialog-vbox1">
<property name="orientation">vertical</property>
<property name="spacing">2</property>
@@ -144,9 +144,6 @@
<object class="GtkBox" id="extension_point">
<property name="spacing">18</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
@@ -263,9 +260,6 @@
<relation type="labelled-by" target="label_widget1"/>
</accessibility>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
@@ -357,19 +351,10 @@
<relation type="labelled-by" target="label_widget2"/>
</accessibility>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
@@ -538,9 +523,6 @@
<property name="valign">baseline</property>
<property name="label">%</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
@@ -552,9 +534,6 @@
<relation type="labelled-by" target="label_widget3"/>
</accessibility>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
@@ -710,14 +689,8 @@
<relation type="labelled-by" target="label_widget4"/>
</accessibility>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
@@ -731,14 +704,8 @@
</object>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="label2">
@@ -820,9 +787,6 @@
<relation type="labelled-by" target="label_widget5"/>
</accessibility>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
@@ -932,9 +896,6 @@
<relation type="labelled-by" target="label_widget6"/>
</accessibility>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
@@ -1008,9 +969,6 @@
<relation type="labelled-by" target="label_widget7"/>
</accessibility>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
@@ -1019,9 +977,6 @@
</packing>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="label3">
@@ -1169,7 +1124,6 @@
</child>
</object>
<packing>
<property name="pack-type">end</property>
<property name="position">1</property>
</packing>
</child>
-6
View File
@@ -45,9 +45,6 @@
<property name="draw-value">0</property>
<signal name="value-changed" handler="cb_scale_value_changed" swapped="no"/>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="minus_button">
@@ -59,9 +56,6 @@
<property name="icon-name">list-remove-symbolic</property>
<signal name="clicked" handler="cb_button_clicked" swapped="no"/>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
-3
View File
@@ -21,9 +21,6 @@
<property name="wrap">1</property>
<property name="max-width-chars">70</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
-15
View File
@@ -143,11 +143,6 @@
<property name="can_focus">False</property>
<property name="icon_name">list-add-symbolic</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label1">
@@ -157,11 +152,6 @@
<property name="use_underline">True</property>
<property name="mnemonic_widget">add_connection_button</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
@@ -242,11 +232,6 @@
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
-214
View File
@@ -1,214 +0,0 @@
#include <gtk/gtk.h>
GtkWidget*
create_flicker (void)
{
GtkWidget *window1;
GtkWidget *hpaned1;
GtkWidget *vpaned2;
GtkWidget *hbox2;
GtkAdjustment *spinbutton7_adj;
GtkWidget *spinbutton7;
GtkAdjustment *spinbutton8_adj;
GtkWidget *spinbutton8;
GtkWidget *vbox1;
GtkAdjustment *spinbutton9_adj;
GtkWidget *spinbutton9;
GtkAdjustment *spinbutton10_adj;
GtkWidget *spinbutton10;
GtkAdjustment *spinbutton11_adj;
GtkWidget *spinbutton11;
GtkAdjustment *spinbutton12_adj;
GtkWidget *spinbutton12;
GtkAdjustment *spinbutton13_adj;
GtkWidget *spinbutton13;
GtkAdjustment *spinbutton14_adj;
GtkWidget *spinbutton14;
GtkAdjustment *spinbutton15_adj;
GtkWidget *spinbutton15;
GtkAdjustment *spinbutton16_adj;
GtkWidget *spinbutton16;
GtkWidget *vpaned1;
GtkWidget *hbox1;
GtkAdjustment *spinbutton17_adj;
GtkWidget *spinbutton17;
GtkAdjustment *spinbutton18_adj;
GtkWidget *spinbutton18;
GtkAdjustment *spinbutton19_adj;
GtkWidget *spinbutton19;
GtkWidget *vbox2;
GtkAdjustment *spinbutton20_adj;
GtkWidget *spinbutton20;
GtkAdjustment *spinbutton21_adj;
GtkWidget *spinbutton21;
GtkAdjustment *spinbutton22_adj;
GtkWidget *spinbutton22;
GtkAdjustment *spinbutton23_adj;
GtkWidget *spinbutton23;
GtkAdjustment *spinbutton24_adj;
GtkWidget *spinbutton24;
GtkAdjustment *spinbutton25_adj;
GtkWidget *spinbutton25;
GtkAdjustment *spinbutton26_adj;
GtkWidget *spinbutton26;
GtkAdjustment *spinbutton27_adj;
GtkWidget *spinbutton27;
window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size (GTK_WINDOW (window1), 500, 400);
gtk_window_set_title (GTK_WINDOW (window1), "window1");
hpaned1 = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
gtk_widget_show (hpaned1);
gtk_container_add (GTK_CONTAINER (window1), hpaned1);
gtk_paned_set_position (GTK_PANED (hpaned1), 100);
vpaned2 = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
gtk_widget_show (vpaned2);
gtk_paned_pack1 (GTK_PANED (hpaned1), vpaned2, FALSE, TRUE);
gtk_paned_set_position (GTK_PANED (vpaned2), 100);
hbox2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_show (hbox2);
gtk_paned_pack1 (GTK_PANED (vpaned2), hbox2, FALSE, TRUE);
spinbutton7_adj = gtk_adjustment_new (1, 0, 100, 1, 10, 10);
spinbutton7 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton7_adj), 1, 0);
gtk_widget_show (spinbutton7);
gtk_box_pack_start (GTK_BOX (hbox2), spinbutton7);
spinbutton8_adj = gtk_adjustment_new (1, 0, 100, 1, 10, 10);
spinbutton8 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton8_adj), 1, 0);
gtk_widget_show (spinbutton8);
gtk_box_pack_start (GTK_BOX (hbox2), spinbutton8);
vbox1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_show (vbox1);
gtk_paned_pack2 (GTK_PANED (vpaned2), vbox1, TRUE, TRUE);
spinbutton9_adj = gtk_adjustment_new (1, 0, 100, 1, 10, 10);
spinbutton9 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton9_adj), 1, 0);
gtk_widget_show (spinbutton9);
gtk_box_pack_start (GTK_BOX (vbox1), spinbutton9);
spinbutton10_adj = gtk_adjustment_new (1, 0, 100, 1, 10, 10);
spinbutton10 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton10_adj), 1, 0);
gtk_widget_show (spinbutton10);
gtk_box_pack_start (GTK_BOX (vbox1), spinbutton10);
spinbutton11_adj = gtk_adjustment_new (1, 0, 100, 1, 10, 10);
spinbutton11 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton11_adj), 1, 0);
gtk_widget_show (spinbutton11);
gtk_box_pack_start (GTK_BOX (vbox1), spinbutton11);
spinbutton12_adj = gtk_adjustment_new (1, 0, 100, 1, 10, 10);
spinbutton12 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton12_adj), 1, 0);
gtk_widget_show (spinbutton12);
gtk_box_pack_start (GTK_BOX (vbox1), spinbutton12);
spinbutton13_adj = gtk_adjustment_new (1, 0, 100, 1, 10, 10);
spinbutton13 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton13_adj), 1, 0);
gtk_widget_show (spinbutton13);
gtk_box_pack_start (GTK_BOX (vbox1), spinbutton13);
spinbutton14_adj = gtk_adjustment_new (1, 0, 100, 1, 10, 10);
spinbutton14 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton14_adj), 1, 0);
gtk_widget_show (spinbutton14);
gtk_box_pack_start (GTK_BOX (vbox1), spinbutton14);
spinbutton15_adj = gtk_adjustment_new (1, 0, 100, 1, 10, 10);
spinbutton15 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton15_adj), 1, 0);
gtk_widget_show (spinbutton15);
gtk_box_pack_start (GTK_BOX (vbox1), spinbutton15);
spinbutton16_adj = gtk_adjustment_new (1, 0, 100, 1, 10, 10);
spinbutton16 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton16_adj), 1, 0);
gtk_widget_show (spinbutton16);
gtk_box_pack_start (GTK_BOX (vbox1), spinbutton16);
vpaned1 = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
gtk_widget_show (vpaned1);
gtk_paned_pack2 (GTK_PANED (hpaned1), vpaned1, TRUE, TRUE);
gtk_paned_set_position (GTK_PANED (vpaned1), 0);
hbox1 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_show (hbox1);
gtk_paned_pack1 (GTK_PANED (vpaned1), hbox1, FALSE, TRUE);
spinbutton17_adj = gtk_adjustment_new (1, 0, 100, 1, 10, 10);
spinbutton17 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton17_adj), 1, 0);
gtk_widget_show (spinbutton17);
gtk_box_pack_start (GTK_BOX (hbox1), spinbutton17);
spinbutton18_adj = gtk_adjustment_new (1, 0, 100, 1, 10, 10);
spinbutton18 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton18_adj), 1, 0);
gtk_widget_show (spinbutton18);
gtk_box_pack_start (GTK_BOX (hbox1), spinbutton18);
spinbutton19_adj = gtk_adjustment_new (1, 0, 100, 1, 10, 10);
spinbutton19 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton19_adj), 1, 0);
gtk_widget_show (spinbutton19);
gtk_box_pack_start (GTK_BOX (hbox1), spinbutton19);
vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_show (vbox2);
gtk_paned_pack2 (GTK_PANED (vpaned1), vbox2, FALSE, FALSE);
spinbutton20_adj = gtk_adjustment_new (1, 0, 100, 1, 10, 10);
spinbutton20 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton20_adj), 1, 0);
gtk_widget_show (spinbutton20);
gtk_box_pack_start (GTK_BOX (vbox2), spinbutton20);
spinbutton21_adj = gtk_adjustment_new (1, 0, 100, 1, 10, 10);
spinbutton21 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton21_adj), 1, 0);
gtk_widget_show (spinbutton21);
gtk_box_pack_start (GTK_BOX (vbox2), spinbutton21);
spinbutton22_adj = gtk_adjustment_new (1, 0, 100, 1, 10, 10);
spinbutton22 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton22_adj), 1, 0);
gtk_widget_show (spinbutton22);
gtk_box_pack_start (GTK_BOX (vbox2), spinbutton22);
spinbutton23_adj = gtk_adjustment_new (1, 0, 100, 1, 10, 10);
spinbutton23 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton23_adj), 1, 0);
gtk_widget_show (spinbutton23);
gtk_box_pack_start (GTK_BOX (vbox2), spinbutton23);
spinbutton24_adj = gtk_adjustment_new (1, 0, 100, 1, 10, 10);
spinbutton24 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton24_adj), 1, 0);
gtk_widget_show (spinbutton24);
gtk_box_pack_start (GTK_BOX (vbox2), spinbutton24);
spinbutton25_adj = gtk_adjustment_new (1, 0, 100, 1, 10, 10);
spinbutton25 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton25_adj), 1, 0);
gtk_widget_show (spinbutton25);
gtk_box_pack_start (GTK_BOX (vbox2), spinbutton25);
spinbutton26_adj = gtk_adjustment_new (1, 0, 100, 1, 10, 10);
spinbutton26 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton26_adj), 1, 0);
gtk_widget_show (spinbutton26);
gtk_box_pack_start (GTK_BOX (vbox2), spinbutton26);
spinbutton27_adj = gtk_adjustment_new (1, 0, 100, 1, 10, 10);
spinbutton27 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton27_adj), 1, 0);
gtk_widget_show (spinbutton27);
gtk_box_pack_end (GTK_BOX (vbox2), spinbutton27);
return window1;
}
int
main (int argc, char *argv[])
{
GtkWidget *window1;
gtk_init ();
window1 = create_flicker ();
gtk_widget_show (window1);
gtk_main ();
return 0;
}
+24 -21
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),
-1
View File
@@ -10,7 +10,6 @@ gtk_tests = [
['scrolling-performance', ['frame-stats.c', 'variable.c']],
['blur-performance', ['../gsk/gskcairoblur.c']],
['simple'],
['flicker'],
['print-editor'],
['video-timer', ['variable.c']],
['testaccel'],
+9 -9
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",

Some files were not shown because too many files have changed in this diff Show More