summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorDaniel Boles <dboles.src@gmail.com>2017-10-11 21:12:33 +0100
committerDaniel Boles <dboles.src@gmail.com>2017-10-11 21:15:54 +0100
commit1e8a166e342568b45ff2f7ac0a49038635ba70fd (patch)
tree4089938572a621aa2c9ec8a366534a5364b37fb2 /gtk
parenteaae832697658601cebe410d3533e89854e38e74 (diff)
downloadgtk+-1e8a166e342568b45ff2f7ac0a49038635ba70fd.tar.gz
ToggleButton: Actually show buttons in new snippet
Also, create a Window, instead of a Dialog without a transient parent, which is (noisily) discouraged. Then s/content_area/box/g to match.
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtktogglebutton.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/gtk/gtktogglebutton.c b/gtk/gtktogglebutton.c
index 66cffe08a7..18912644ed 100644
--- a/gtk/gtktogglebutton.c
+++ b/gtk/gtktogglebutton.c
@@ -70,29 +70,30 @@
* }
*
* void make_toggles (void) {
- * GtkWidget *dialog, *toggle1, *toggle2;
- * GtkWidget *content_area;
- * const char *text;
+ * GtkWidget *window, *toggle1, *toggle2;
+ * GtkWidget *box;
+ * const char *text;
*
- * dialog = gtk_dialog_new ();
- * content_area = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
+ * window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ * box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
*
- * text = "Hi, i’m a toggle button.";
- * toggle1 = gtk_toggle_button_new_with_label (text);
+ * text = "Hi, I’m a toggle button.";
+ * toggle1 = gtk_toggle_button_new_with_label (text);
*
- * g_signal_connect (toggle1, "toggled",
- * G_CALLBACK (output_state),
- * NULL);
- * gtk_container_add (GTK_CONTAINER (content_area), toggle1);
+ * g_signal_connect (toggle1, "toggled",
+ * G_CALLBACK (output_state),
+ * NULL);
+ * gtk_container_add (GTK_CONTAINER (box), toggle1);
*
- * text = "Hi, i’m a toggle button.";
- * toggle2 = gtk_toggle_button_new_with_label (text);
- * g_signal_connect (toggle2, "toggled",
- * G_CALLBACK (output_state),
- * NULL);
- * gtk_container_add (GTK_CONTAINER (content_area), toggle2);
+ * text = "Hi, I’m a toggle button.";
+ * toggle2 = gtk_toggle_button_new_with_label (text);
+ * g_signal_connect (toggle2, "toggled",
+ * G_CALLBACK (output_state),
+ * NULL);
+ * gtk_container_add (GTK_CONTAINER (box), toggle2);
*
- * gtk_widget_show (dialog);
+ * gtk_container_add (GTK_CONTAINER (window), box);
+ * gtk_widget_show (window);
* }
* ]|
*/