]> Pileus Git - ~andy/gtk/commitdiff
gtk_init*(): Document that argc/argv can be 0,NULL.
authorMurray Cumming <murrayc@murrayc.com>
Sat, 5 Mar 2011 13:53:52 +0000 (14:53 +0100)
committerMurray Cumming <murrayc@murrayc.com>
Sat, 5 Mar 2011 13:57:32 +0000 (14:57 +0100)
* gtk/gtkmain.c: (gtk_init): Mention that argc and argv can be 0,
  using the new text from the g_applicatoin_run() documentation.
  There was already introspection annotation about that.
  (gtk_init_check, gtk_init_with_args): Use the same text here.
  See bug #643649 comment 2.

gtk/gtkmain.c

index 47af37774a531464fc59e5cff6307577d390a8f3..9eda5a9f4135bbc99da7a3c3ea3df1bebc81fe54 100644 (file)
@@ -985,9 +985,12 @@ gtk_get_option_group (gboolean open_default_display)
 
 /**
  * gtk_init_with_args:
- * @argc: a pointer to the number of command line arguments
- * @argv: (inout) (array length=argc): a pointer to the array of
- * command line arguments
+ * @argc: (inout): Address of the <parameter>argc</parameter> parameter of
+ *     your main() function (or 0 if @argv is %NULL). This will be changed if 
+ *     any arguments were handled.
+ * @argv: (array length=argc) (inout) (allow-none): Address of the
+ *     <parameter>argv</parameter> parameter of main(), or %NULL. Any options
+ *     understood by GTK+ are stripped before return.
  * @parameter_string: a string which is displayed in
  *    the first line of <option>--help</option> output, after
  *    <literal><replaceable>programname</replaceable> [OPTION...]</literal>
@@ -1102,10 +1105,11 @@ gtk_parse_args (int    *argc,
 /**
  * gtk_init_check:
  * @argc: (inout): Address of the <parameter>argc</parameter> parameter of
- *     your main() function. Changed if any arguments were handled
+ *     your main() function (or 0 if @argv is %NULL). This will be changed if 
+ *     any arguments were handled.
  * @argv: (array length=argc) (inout) (allow-none): Address of the
- *     <parameter>argv</parameter> parameter of main()
- *   Any parameters understood by gtk_init() are stripped before return
+ *     <parameter>argv</parameter> parameter of main(), or %NULL. Any options
+ *     understood by GTK+ are stripped before return.
  *
  * This function does the same work as gtk_init() with only a single
  * change: It does not terminate the program if the windowing system
@@ -1135,15 +1139,20 @@ gtk_init_check (int    *argc,
 /**
  * gtk_init:
  * @argc: (inout): Address of the <parameter>argc</parameter> parameter of
- *     your main() function. Changed if any arguments were handled
+ *     your main() function (or 0 if @argv is %NULL). This will be changed if 
+ *     any arguments were handled.
  * @argv: (array length=argc) (inout) (allow-none): Address of the
- *     <parameter>argv</parameter> parameter of main(). Any options
+ *     <parameter>argv</parameter> parameter of main(), or %NULL. Any options
  *     understood by GTK+ are stripped before return.
  *
  * Call this function before using any other GTK+ functions in your GUI
  * applications.  It will initialize everything needed to operate the
  * toolkit and parses some standard command line options.
  *
+ * Although you are expected to pass the @argc, @argv parameters from main() to 
+ * this function, it is possible to pass %NULL if @argv is not available or 
+ * commandline handling is not required.
+ *
  * @argc and @argv are adjusted accordingly so your own code will
  * never see those standard arguments.
  *