summaryrefslogtreecommitdiff
path: root/docs/tools
diff options
context:
space:
mode:
authorWilliam Jon McCann <william.jon.mccann@gmail.com>2014-02-13 04:01:41 -0500
committerMatthias Clasen <mclasen@redhat.com>2014-02-13 20:47:25 -0500
commit1f38477f297597a599f820323728aa8bc46852f1 (patch)
tree61e7ce9aa25a011c539c5340fbddf582d4f75ef3 /docs/tools
parent57c618e887182ad97118a17cf37a000c940cc839 (diff)
downloadgtk+-1f38477f297597a599f820323728aa8bc46852f1.tar.gz
docs: fix the doc shooting for the volume button
Diffstat (limited to 'docs/tools')
-rw-r--r--docs/tools/widgets.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/docs/tools/widgets.c b/docs/tools/widgets.c
index 2db4bbfdee..3b9d3398bb 100644
--- a/docs/tools/widgets.c
+++ b/docs/tools/widgets.c
@@ -1079,15 +1079,25 @@ create_spinner (void)
static WidgetInfo *
create_volume_button (void)
{
- GtkWidget *button, *widget;
- GtkWidget *plus_button;
+ GtkWidget *button, *box;
+ GtkWidget *widget;
+ GtkWidget *popup;
+
+ widget = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ gtk_widget_set_size_request (widget, 100, 250);
+
+ box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+ gtk_container_add (GTK_CONTAINER (widget), box);
button = gtk_volume_button_new ();
+ gtk_box_pack_end (GTK_BOX (box), button, FALSE, FALSE, 0);
+
gtk_scale_button_set_value (GTK_SCALE_BUTTON (button), 33);
- /* Hack: get the private dock */
- plus_button = gtk_scale_button_get_plus_button (GTK_SCALE_BUTTON (button));
- widget = gtk_widget_get_parent (gtk_widget_get_parent (gtk_widget_get_parent (plus_button)));
- gtk_widget_show_all (widget);
+ popup = gtk_scale_button_get_popup (GTK_SCALE_BUTTON (button));
+ gtk_widget_realize (widget);
+ gtk_widget_show (box);
+ gtk_widget_show (popup);
+
return new_widget_info ("volumebutton", widget, ASIS);
}