W Wrapl, The Programming Language

Libraries:Gtk:Gtk:Init

Functions

Add(function @ Std.Function.T, data @ Std.Address.T) : Std.Object.T

Warning

Gtk.Gtk.Main.InitAdd is deprecated and should not be used in newly-written code. This function is going to be removed in GTK+ 3.0



Check(argc @ Std.Object.T, argv @ Std.Object.T) : Std.Symbol.T

This function does the same work as gtk_init() with only a single change: It does not terminate the program if the GUI can't be initialized. Instead it returns FALSE on failure.

This way the application can fall back to some other means of communication with the user - for example a curses or command line interface.

argc Address of the argc parameter of your main() function. Changed if any arguments were handled. [inout]
argv Address of the argv parameter of main(). Any parameters understood by gtk_init() are stripped before return. [array length=argc][inout][allow-none]
Returns TRUE if the GUI has been successfully initialized, FALSE otherwise.


WithArgs(argc @ Std.Object.T, argv @ Std.Object.T, parameter_string @ Std.String.T, entries @ Gtk.Glib.GOptionEntry.T, translation_domain @ Std.String.T, error @ Std.Object.T) : Std.Symbol.T

This function does the same work as Check. Additionally, it allows you to add your own commandline options, and it automatically generates nicely formatted --help output. Note that your program will be terminated after writing out the help output.

argc a pointer to the number of command line arguments.
argv a pointer to the array of command line arguments. [inout][array length=argc]
parameter_string a string which is displayed in the first line of --help output, after programname [OPTION...]
entries a NULL-terminated array of GOptionEntrys describing the options of your program. [array zero-terminated=1]
translation_domain a translation domain to use for translating the --help output for the options in entries with gettext(), or NULL
error a return location for errors
Returns TRUE if the GUI has been successfully initialized, FALSE otherwise.