summaryrefslogtreecommitdiff
path: root/gtk/gtkfilechooserdialog.c
diff options
context:
space:
mode:
authorWilliam Jon McCann <william.jon.mccann@gmail.com>2014-02-12 16:09:09 -0500
committerWilliam Jon McCann <william.jon.mccann@gmail.com>2014-02-12 18:42:50 -0500
commit37a8ee6e952fb8c837ffbabfe3a5068b08e75b13 (patch)
treed48dc51ab27f65571678687ef1d254f4caa85d32 /gtk/gtkfilechooserdialog.c
parent74c48203f0a790ae6b6bb33cf7cf6ed2c3a4d3d5 (diff)
downloadgtk+-37a8ee6e952fb8c837ffbabfe3a5068b08e75b13.tar.gz
docs: fully break lines in examples
Try to do a better job of keeping example content from being too wide. It is often rendered as <pre> text so the only time we can wrap it is in the source. It is best to full break lines at all punctuation and to try to keep the width under 70 chars or so.
Diffstat (limited to 'gtk/gtkfilechooserdialog.c')
-rw-r--r--gtk/gtkfilechooserdialog.c52
1 files changed, 35 insertions, 17 deletions
diff --git a/gtk/gtkfilechooserdialog.c b/gtk/gtkfilechooserdialog.c
index 771f38e007..70eea814a9 100644
--- a/gtk/gtkfilechooserdialog.c
+++ b/gtk/gtkfilechooserdialog.c
@@ -59,19 +59,24 @@
*
* |[
* GtkWidget *dialog;
+ * GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_OPEN;
+ * gint res;
*
* dialog = gtk_file_chooser_dialog_new ("Open File",
* parent_window,
- * GTK_FILE_CHOOSER_ACTION_OPEN,
- * _("_Cancel"), GTK_RESPONSE_CANCEL,
- * _("_Open"), GTK_RESPONSE_ACCEPT,
+ * action,
+ * _("_Cancel"),
+ * GTK_RESPONSE_CANCEL,
+ * _("_Open"),
+ * GTK_RESPONSE_ACCEPT,
* NULL);
*
- * if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
+ * res = gtk_dialog_run (GTK_DIALOG (dialog));
+ * if (res == GTK_RESPONSE_ACCEPT)
* {
* char *filename;
- *
- * filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
+ * GtkFileChooser *chooser = GTK_FILE_CHOOSER (dialog);
+ * filename = gtk_file_chooser_get_filename (chooser);
* open_file (filename);
* g_free (filename);
* }
@@ -83,25 +88,35 @@
*
* |[
* GtkWidget *dialog;
+ * GtkFileChooser *chooser;
+ * GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_SAVE;
+ * gint res;
*
* dialog = gtk_file_chooser_dialog_new ("Save File",
* parent_window,
- * GTK_FILE_CHOOSER_ACTION_SAVE,
- * _("_Cancel"), GTK_RESPONSE_CANCEL,
- * _("_Save"), GTK_RESPONSE_ACCEPT,
+ * action,
+ * _("_Cancel"),
+ * GTK_RESPONSE_CANCEL,
+ * _("_Save"),
+ * GTK_RESPONSE_ACCEPT,
* NULL);
- * gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE);
+ * chooser = GTK_FILE_CHOOSER (dialog);
+ *
+ * gtk_file_chooser_set_do_overwrite_confirmation (chooser, TRUE);
*
* if (user_edited_a_new_document)
- * gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), "Untitled document");
+ * gtk_file_chooser_set_current_name (chooser,
+ * _("Untitled document"));
* else
- * gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (dialog), filename_for_existing_document);
+ * gtk_file_chooser_set_filename (chooser,
+ * existing_filename);
*
- * if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
+ * res = gtk_dialog_run (GTK_DIALOG (dialog));
+ * if (res == GTK_RESPONSE_ACCEPT)
* {
* char *filename;
*
- * filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
+ * filename = gtk_file_chooser_get_filename (chooser);
* save_to_file (filename);
* g_free (filename);
* }
@@ -143,12 +158,15 @@
*
* |[
* GtkWidget *dialog;
+ * GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_OPEN;
*
* dialog = gtk_file_chooser_dialog_new ("Open File",
* parent_window,
- * GTK_FILE_CHOOSER_ACTION_OPEN,
- * _("_Cancel"), GTK_RESPONSE_CANCEL,
- * _("_Open"), GTK_RESPONSE_ACCEPT,
+ * action,
+ * _("_Cancel"),
+ * GTK_RESPONSE_CANCEL,
+ * _("_Open"),
+ * GTK_RESPONSE_ACCEPT,
* NULL);
* ]|
*