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.Dazzle.Objects.MenuManager
Description
The goal of MenuManager
is to simplify the process of merging multiple
GtkBuilder .ui files containing menus into a single representation of the
application menus. Additionally, it provides the ability to "unmerge"
previously merged menus.
This allows for an application to have plugins which seemlessly extends the core application menus.
Implementation notes:
To make this work, we don't use the GMenu instances created by a GtkBuilder
instance. Instead, we create the menus ourself and recreate section and
submenu links. This allows the MenuManager
to be in full control of
the generated menus.
menuManagerGetMenuById
will always return a Menu
, however
that menu may contain no children until something has extended it later
on during the application process.
Since: 3.26
Synopsis
- newtype MenuManager = MenuManager (ManagedPtr MenuManager)
- class (GObject o, IsDescendantOf MenuManager o) => IsMenuManager o
- toMenuManager :: (MonadIO m, IsMenuManager o) => o -> m MenuManager
- menuManagerAddFilename :: (HasCallStack, MonadIO m, IsMenuManager a) => a -> Text -> m Word32
- menuManagerAddResource :: (HasCallStack, MonadIO m, IsMenuManager a) => a -> Text -> m Word32
- menuManagerGetMenuById :: (HasCallStack, MonadIO m, IsMenuManager a) => a -> Text -> m Menu
- menuManagerMerge :: (HasCallStack, MonadIO m, IsMenuManager a, IsMenuModel b) => a -> Text -> b -> m Word32
- menuManagerNew :: (HasCallStack, MonadIO m) => m MenuManager
- menuManagerRemove :: (HasCallStack, MonadIO m, IsMenuManager a) => a -> Word32 -> m ()
Exported types
newtype MenuManager Source #
Memory-managed wrapper type.
Constructors
MenuManager (ManagedPtr MenuManager) |
Instances
Eq MenuManager Source # | |
Defined in GI.Dazzle.Objects.MenuManager | |
GObject MenuManager Source # | |
Defined in GI.Dazzle.Objects.MenuManager | |
ManagedPtrNewtype MenuManager Source # | |
Defined in GI.Dazzle.Objects.MenuManager Methods toManagedPtr :: MenuManager -> ManagedPtr MenuManager | |
TypedObject MenuManager Source # | |
Defined in GI.Dazzle.Objects.MenuManager | |
HasParentTypes MenuManager Source # | |
Defined in GI.Dazzle.Objects.MenuManager | |
IsGValue (Maybe MenuManager) Source # | Convert |
Defined in GI.Dazzle.Objects.MenuManager Methods gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe MenuManager -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe MenuManager) | |
type ParentTypes MenuManager Source # | |
Defined in GI.Dazzle.Objects.MenuManager type ParentTypes MenuManager = '[Object] |
class (GObject o, IsDescendantOf MenuManager o) => IsMenuManager o Source #
Type class for types which can be safely cast to MenuManager
, for instance with toMenuManager
.
Instances
(GObject o, IsDescendantOf MenuManager o) => IsMenuManager o Source # | |
Defined in GI.Dazzle.Objects.MenuManager |
toMenuManager :: (MonadIO m, IsMenuManager o) => o -> m MenuManager Source #
Cast to MenuManager
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Click to display all available methods, including inherited ones
Methods
addFilename, addResource, bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, merge, notify, notifyByPspec, ref, refSink, remove, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getData, getMenuById, getProperty, getQdata.
Setters
addFilename
menuManagerAddFilename Source #
Arguments
:: (HasCallStack, MonadIO m, IsMenuManager a) | |
=> a | |
-> Text | |
-> m Word32 | (Can throw |
No description available in the introspection data.
addResource
menuManagerAddResource Source #
Arguments
:: (HasCallStack, MonadIO m, IsMenuManager a) | |
=> a | |
-> Text | |
-> m Word32 | (Can throw |
No description available in the introspection data.
getMenuById
menuManagerGetMenuById Source #
Arguments
:: (HasCallStack, MonadIO m, IsMenuManager a) | |
=> a | |
-> Text | |
-> m Menu | Returns: A |
No description available in the introspection data.
merge
menuManagerMerge :: (HasCallStack, MonadIO m, IsMenuManager a, IsMenuModel b) => a -> Text -> b -> m Word32 Source #
No description available in the introspection data.
new
menuManagerNew :: (HasCallStack, MonadIO m) => m MenuManager Source #
No description available in the introspection data.
remove
Arguments
:: (HasCallStack, MonadIO m, IsMenuManager a) | |
=> a |
|
-> Word32 |
|
-> m () |
This removes items from menus that were added as part of a previous
menu merge. Use the value returned from menuManagerMerge
as
the mergeId
.
Since: 3.26