| Copyright | Will Thompson and Iñaki García Etxebarria | 
|---|---|
| License | LGPL-2.1 | 
| Maintainer | Iñaki García Etxebarria | 
| Safe Haskell | Safe-Inferred | 
| Language | Haskell2010 | 
GI.GLib.Structs.OptionGroup
Description
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)
 - 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.
Constructors
| OptionGroup (ManagedPtr OptionGroup) | 
Instances
| Eq OptionGroup Source # | |
Defined in GI.GLib.Structs.OptionGroup  | |
| GBoxed OptionGroup Source # | |
Defined in GI.GLib.Structs.OptionGroup  | |
| ManagedPtrNewtype OptionGroup Source # | |
Defined in GI.GLib.Structs.OptionGroup Methods toManagedPtr :: OptionGroup -> ManagedPtr OptionGroup  | |
| TypedObject OptionGroup Source # | |
Defined in GI.GLib.Structs.OptionGroup  | |
| HasParentTypes OptionGroup Source # | |
Defined in GI.GLib.Structs.OptionGroup  | |
| IsGValue (Maybe OptionGroup) Source # | Convert   | 
Defined in GI.GLib.Structs.OptionGroup Methods gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe OptionGroup -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe OptionGroup)  | |
| type ParentTypes OptionGroup Source # | |
Defined in GI.GLib.Structs.OptionGroup  | |
Methods
Click to display all available methods, including inherited ones
addEntries
optionGroupAddEntries Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => OptionGroup | 
  | 
| -> [OptionEntry] | 
  | 
| -> m () | 
Adds the options specified in entries to group.
Since: 2.6
free
Arguments
| :: (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
Arguments
| :: (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.
description is typically used to provide a title for the group. If so, it
 is recommended that it’s written in title case, and has a trailing colon so
 that it matches the style of built-in GLib group titles such as
 ‘Application Options:’.
Since: 2.6
ref
Arguments
| :: (HasCallStack, MonadIO m) | |
| => OptionGroup | 
  | 
| -> m OptionGroup | Returns: a   | 
Increments the reference count of group by one.
Since: 2.44
setTranslateFunc
optionGroupSetTranslateFunc Source #
Arguments
| :: (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 #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => OptionGroup | 
  | 
| -> Text | 
  | 
| -> m () | 
A convenience function to use gettext() for translating
 user-visible strings.
Since: 2.6
unref
Arguments
| :: (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