summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk/gtkdialog.c10
-rw-r--r--gtk/gtkinfobar.c13
-rw-r--r--gtk/gtkmain.c5
-rw-r--r--gtk/gtkprintcontext.c2
-rw-r--r--gtk/gtkradiobutton.c8
-rw-r--r--gtk/gtktextview.c10
-rw-r--r--gtk/gtktoolpalette.c2
7 files changed, 30 insertions, 20 deletions
diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c
index 67c3c40e02..151dc85a09 100644
--- a/gtk/gtkdialog.c
+++ b/gtk/gtkdialog.c
@@ -792,6 +792,7 @@ gtk_dialog_new_empty (const gchar *title,
*
* Here’s a simple example:
* |[<!-- language="C" -->
+ * GtkWidget *main_app_window; // Window the dialog should show up on
* GtkWidget *dialog;
* GtkDialogFlags flags = GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT;
* dialog = gtk_dialog_new_with_buttons ("My dialog",
@@ -1168,14 +1169,17 @@ run_destroy_handler (GtkDialog *dialog, gpointer data)
*
* Typical usage of this function might be:
* |[<!-- language="C" -->
- * gint result = gtk_dialog_run (GTK_DIALOG (dialog));
+ * GtkWidget *dialog = gtk_dialog_new ();
+ * // Set up dialog...
+ *
+ * int result = gtk_dialog_run (GTK_DIALOG (dialog));
* switch (result)
* {
* case GTK_RESPONSE_ACCEPT:
- * do_application_specific_something ();
+ * // do_application_specific_something ();
* break;
* default:
- * do_nothing_since_dialog_was_cancelled ();
+ * // do_nothing_since_dialog_was_cancelled ();
* break;
* }
* gtk_widget_destroy (dialog);
diff --git a/gtk/gtkinfobar.c b/gtk/gtkinfobar.c
index b5ea64354e..11170b241a 100644
--- a/gtk/gtkinfobar.c
+++ b/gtk/gtkinfobar.c
@@ -73,17 +73,18 @@
* by using gtk_info_bar_set_message_type(). GTK+ may use the message type
* to determine how the message is displayed.
*
- * A simple example for using a GtkInfoBar:
+ * A simple example for using a #GtkInfoBar:
* |[<!-- language="C" -->
- * // set up info bar
- * GtkWidget *widget;
+ * GtkWidget *widget, *message_label, *content_area;
+ * GtkWidget *grid;
* GtkInfoBar *bar;
*
+ * // set up info bar
* widget = gtk_info_bar_new ();
* bar = GTK_INFO_BAR (widget);
+ * grid = gtk_grid_new ();
*
* message_label = gtk_label_new ("");
- * gtk_widget_show (message_label);
* content_area = gtk_info_bar_get_content_area (bar);
* gtk_container_add (GTK_CONTAINER (content_area),
* message_label);
@@ -98,10 +99,10 @@
* widget,
* 0, 2, 1, 1);
*
- * ...
+ * // ...
*
* // show an error message
- * gtk_label_set_text (GTK_LABEL (message_label), message);
+ * gtk_label_set_text (GTK_LABEL (message_label), "An error occurred!");
* gtk_info_bar_set_message_type (bar,
* GTK_MESSAGE_ERROR);
* gtk_widget_show (bar);
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 146499d056..48c3aaeeec 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -59,9 +59,10 @@
* int
* main (int argc, char **argv)
* {
+ * GtkWidget *mainwin;
* // Initialize i18n support with bindtextdomain(), etc.
*
- * ...
+ * // ...
*
* // Initialize the widget set
* gtk_init ();
@@ -71,7 +72,7 @@
*
* // Set up our GUI elements
*
- * ...
+ * // ...
*
* // Show the application window
* gtk_widget_show (mainwin);
diff --git a/gtk/gtkprintcontext.c b/gtk/gtkprintcontext.c
index d3c5a02635..21d68bfa85 100644
--- a/gtk/gtkprintcontext.c
+++ b/gtk/gtkprintcontext.c
@@ -69,7 +69,7 @@
* cairo_stroke (cr);
*
* // Draw some text
- * layout = gtk_print_context_create_layout (context);
+ * layout = gtk_print_context_create_pango_layout (context);
* pango_layout_set_text (layout, "Hello World! Printing is easy", -1);
* desc = pango_font_description_from_string ("sans 28");
* pango_layout_set_font_description (layout, desc);
diff --git a/gtk/gtkradiobutton.c b/gtk/gtkradiobutton.c
index 652d878ece..a2cdaaa667 100644
--- a/gtk/gtkradiobutton.c
+++ b/gtk/gtkradiobutton.c
@@ -114,8 +114,8 @@
* "I’m the second radio button.");
*
* // Pack them into a box, then show all the widgets
- * gtk_box_pack_start (GTK_BOX (box), radio1, TRUE, TRUE, 2);
- * gtk_box_pack_start (GTK_BOX (box), radio2, TRUE, TRUE, 2);
+ * gtk_box_pack_start (GTK_BOX (box), radio1);
+ * gtk_box_pack_start (GTK_BOX (box), radio2);
* gtk_container_add (GTK_CONTAINER (window), box);
* gtk_widget_show (window);
* return;
@@ -383,9 +383,9 @@ gtk_radio_button_set_group (GtkRadioButton *radio_button,
* GtkRadioButton *radio_button;
* GtkRadioButton *last_button;
*
- * while ( ...more buttons to add... )
+ * while (some_condition)
* {
- * radio_button = gtk_radio_button_new (...);
+ * radio_button = gtk_radio_button_new (NULL);
*
* gtk_radio_button_join_group (radio_button, last_button);
* last_button = radio_button;
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 1a9cae967d..ac7ca5b824 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -7741,13 +7741,17 @@ gtk_text_view_reset_im_context (GtkTextView *text_view)
* gtk_foo_bar_key_press_event (GtkWidget *widget,
* GdkEventKey *event)
* {
- * if ((key->keyval == GDK_KEY_Return || key->keyval == GDK_KEY_KP_Enter))
+ * guint keyval;
+ *
+ * gdk_event_get_keyval ((GdkEvent*)event, &keyval);
+ *
+ * if (keyval == GDK_KEY_Return || keyval == GDK_KEY_KP_Enter)
* {
- * if (gtk_text_view_im_context_filter_keypress (GTK_TEXT_VIEW (view), event))
+ * if (gtk_text_view_im_context_filter_keypress (GTK_TEXT_VIEW (widget), event))
* return TRUE;
* }
*
- * // Do some stuff
+ * // Do some stuff
*
* return GTK_WIDGET_CLASS (gtk_foo_bar_parent_class)->key_press_event (widget, event);
* }
diff --git a/gtk/gtktoolpalette.c b/gtk/gtktoolpalette.c
index 1fa4c00c72..a30d869e9a 100644
--- a/gtk/gtktoolpalette.c
+++ b/gtk/gtktoolpalette.c
@@ -61,7 +61,7 @@
* group = gtk_tool_item_group_new (_("Test Category"));
* gtk_container_add (GTK_CONTAINER (palette), group);
*
- * item = gtk_tool_button_new_new (NULL, _("_Open"));
+ * item = gtk_tool_button_new (NULL, _("_Open"));
* gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item), "document-open");
* gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
* ]|