Libraries:Gtk:Glib:GOptionGroup
Types
T
Constants
Nil : T
Functions
New(name @ Std.String.T, description @ Std.String.T, help_description @ Std.String.T, user_data @ Std.Object.T, destroy @ Std.Function.T) : Gtk.Glib.GOptionGroup.T
Creates a new T.
name | the name for the option group, this is used to provide help for the options in this group with --help-name |
description | a description for this group to be shown in --help. This string is translated using the translation domain or translation function of the group |
help_description | a description for the --help-name option. This string is translated using the translation domain or translation function of the group |
user_data | user data that will be passed to the pre- and post-parse hooks, the error hook and to callbacks of Gtk.Glib.GOptionArg.Callback options, or NULL |
destroy | a function that will be called to free user_data, or NULL |
Returns | a newly created option group. It should be added to a Gtk.Glib.GOptionContext.T or freed with Free. |
Methods
:"="(_ @ T, _ @ T)
:AddEntries(self @ T, entries @ Gtk.Glib.GOptionEntry.T) : Std.Object.T
Adds the options specified in entries to group.
group | a T |
entries | a NULL-terminated array of Gtk.Glib.GOptionEntry.Ts |
:Free(self @ T) : Std.Object.T
Frees a T. Note that you must not free groups which have been added to a Gtk.Glib.GOptionContext.T.
group | a T |
:SetErrorHook(self @ T, error_func @ Std.Function.T) : Std.Object.T
Associates a function with group which will be called from Gtk.Glib.GOptionContext.Parse when an error occurs.
Note that the user data to be passed to error_func can be specified when constructing the group with g_option_group_new().
group | a T |
error_func | a function to call when an error occurs |
:SetParseHooks(self @ T, pre_parse_func @ Std.Function.T, post_parse_func @ Std.Function.T) : Std.Object.T
Associates two functions with group which will be called from Gtk.Glib.GOptionContext.Parse before the first option is parsed and after the last option has been parsed, respectively.
Note that the user data to be passed to pre_parse_func and post_parse_func can be specified when constructing the group with g_option_group_new().
group | a T |
pre_parse_func | a function to call before parsing, or NULL |
post_parse_func | a function to call after parsing, or NULL |
:SetTranslateFunc(self @ T, func @ Std.Object.T, data @ Std.Address.T, destroy_notify @ Std.Function.T) : Std.Object.T
Sets the function which is used to translate user-visible strings, for --help output. Different groups can use different GTranslateFuncs. If func is NULL, strings are not translated.
If you are using gettext(), you only need to set the translation domain, see SetTranslationDomain.
group | a T |
func | the GTranslateFunc, or NULL |
data | user data to pass to func, or NULL |
destroy_notify | a function which gets called to free data, or NULL |
:SetTranslationDomain(self @ T, domain @ Std.String.T) : Std.Object.T
A convenience function to use gettext() for translating user-visible strings.
group | a T |
domain | the domain to use |