OptionGroup

A GOptionGroup struct defines the options in a single group. The struct has only private fields and should not be directly accessed.

All options in a group share the same translation function. Libraries which need to parse commandline options are expected to provide a function for getting a GOptionGroup holding their options, which the application can then add to its glib.OptionContext

Constructors

this
this(GOptionGroup* gOptionGroup, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this(string name, string description, string helpDescription, void* userData, GDestroyNotify destroy)

Creates a new glib.OptionGroup

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Functions

addEntries
void addEntries(GOptionEntry[] entries)

Adds the options specified in entries to group.

free
void free()

Frees a glib.OptionGroup Note that you must not free groups which have been added to a glib.OptionContext

getOptionGroupStruct
GOptionGroup* getOptionGroupStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

ref_
OptionGroup ref_()

Increments the reference count of group by one.

setErrorHook
void setErrorHook(GOptionErrorFunc errorFunc)

Associates a function with group which will be called from OptionContext.parse when an error occurs.

setParseHooks
void setParseHooks(GOptionParseFunc preParseFunc, GOptionParseFunc postParseFunc)

Associates two functions with group which will be called from OptionContext.parse before the first option is parsed and after the last option has been parsed, respectively.

setTranslateFunc
void setTranslateFunc(GTranslateFunc func, void* data, GDestroyNotify destroyNotify)

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.

setTranslationDomain
void setTranslationDomain(string domain)

A convenience function to use gettext() for translating user-visible strings.

unref
void unref()

Decrements the reference count of group by one. If the reference count drops to 0, the group will be freed. and all memory allocated by the group is released.

Variables

gOptionGroup
GOptionGroup* gOptionGroup;

the main Gtk struct