gi-dazzle-1.0.2: libdazzle bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

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

Exported types

newtype MenuManager Source #

Memory-managed wrapper type.

Constructors

MenuManager (ManagedPtr MenuManager) 

Instances

Instances details
Eq MenuManager Source # 
Instance details

Defined in GI.Dazzle.Objects.MenuManager

GObject MenuManager Source # 
Instance details

Defined in GI.Dazzle.Objects.MenuManager

ManagedPtrNewtype MenuManager Source # 
Instance details

Defined in GI.Dazzle.Objects.MenuManager

Methods

toManagedPtr :: MenuManager -> ManagedPtr MenuManager

TypedObject MenuManager Source # 
Instance details

Defined in GI.Dazzle.Objects.MenuManager

Methods

glibType :: IO GType

HasParentTypes MenuManager Source # 
Instance details

Defined in GI.Dazzle.Objects.MenuManager

IsGValue (Maybe MenuManager) Source #

Convert MenuManager to and from GValue. See toGValue and fromGValue.

Instance details

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 # 
Instance details

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

Instances details
(GObject o, IsDescendantOf MenuManager o) => IsMenuManager o Source # 
Instance details

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

addFilename

menuManagerAddFilename Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuManager a) 
=> a 
-> Text 
-> m Word32

(Can throw GError)

No description available in the introspection data.

addResource

menuManagerAddResource Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuManager a) 
=> a 
-> Text 
-> m Word32

(Can throw GError)

No description available in the introspection data.

getMenuById

menuManagerGetMenuById Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuManager a) 
=> a 
-> Text 
-> m Menu

Returns: A Menu.

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

menuManagerRemove Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuManager a) 
=> a

self: a MenuManager

-> Word32

mergeId: A previously registered merge id

-> 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