Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
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 OptionContext
.
Synopsis
- newtype OptionGroup = OptionGroup (ManagedPtr OptionGroup)
- noOptionGroup :: Maybe OptionGroup
- optionGroupAddEntries :: (HasCallStack, MonadIO m) => OptionGroup -> OptionEntry -> m ()
- optionGroupFree :: (HasCallStack, MonadIO m) => OptionGroup -> m ()
- optionGroupNew :: (HasCallStack, MonadIO m) => Text -> Text -> Text -> Ptr () -> Maybe DestroyNotify -> m OptionGroup
- optionGroupRef :: (HasCallStack, MonadIO m) => OptionGroup -> m OptionGroup
- optionGroupSetTranslateFunc :: (HasCallStack, MonadIO m) => OptionGroup -> Maybe TranslateFunc -> m ()
- optionGroupSetTranslationDomain :: (HasCallStack, MonadIO m) => OptionGroup -> Text -> m ()
- optionGroupUnref :: (HasCallStack, MonadIO m) => OptionGroup -> m ()
Exported types
newtype OptionGroup Source #
Memory-managed wrapper type.
Instances
BoxedObject OptionGroup Source # | |
Defined in GI.GLib.Structs.OptionGroup boxedType :: OptionGroup -> IO GType # |
noOptionGroup :: Maybe OptionGroup Source #
A convenience alias for Nothing
:: Maybe
OptionGroup
.
Methods
addEntries
optionGroupAddEntries Source #
:: (HasCallStack, MonadIO m) | |
=> OptionGroup |
|
-> OptionEntry |
|
-> m () |
Adds the options specified in entries
to group
.
Since: 2.6
free
:: (HasCallStack, MonadIO m) | |
=> OptionGroup |
|
-> m () |
Deprecated: (Since version 2.44)Use optionGroupUnref
instead.
Frees a OptionGroup
. Note that you must not free groups
which have been added to a OptionContext
.
Since: 2.6
new
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Text |
|
-> Text |
|
-> Ptr () |
|
-> Maybe DestroyNotify |
|
-> m OptionGroup | Returns: a newly created option group. It should be added
to a |
Creates a new OptionGroup
.
Since: 2.6
ref
:: (HasCallStack, MonadIO m) | |
=> OptionGroup |
|
-> m OptionGroup | Returns: a |
Increments the reference count of group
by one.
Since: 2.44
setTranslateFunc
optionGroupSetTranslateFunc Source #
:: (HasCallStack, MonadIO m) | |
=> OptionGroup |
|
-> Maybe TranslateFunc |
|
-> m () |
Sets the function which is used to translate user-visible strings,
for --help
output. Different groups can use different
GTranslateFuncs
. If func
is Nothing
, strings are not translated.
If you are using gettext()
, you only need to set the translation
domain, see optionGroupSetTranslationDomain
.
Since: 2.6
setTranslationDomain
optionGroupSetTranslationDomain Source #
:: (HasCallStack, MonadIO m) | |
=> OptionGroup |
|
-> Text |
|
-> m () |
A convenience function to use gettext()
for translating
user-visible strings.
Since: 2.6
unref
:: (HasCallStack, MonadIO m) | |
=> OptionGroup |
|
-> m () |
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.
Since: 2.44