Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
A MenuToolButton
is a ToolItem
that contains a button and
a small additional button with an arrow. When clicked, the arrow
button pops up a dropdown menu.
Use menuToolButtonNew
to create a new
MenuToolButton
.
GtkMenuToolButton as GtkBuildable
The GtkMenuToolButton implementation of the GtkBuildable interface supports adding a menu by specifying “menu” as the “type” attribute of a <child> element.
An example for a UI definition fragment with menus: > >class="GtkMenuToolButton" > type="menu" > class="GtkMenu"/ > /child >/object
Synopsis
- newtype MenuToolButton = MenuToolButton (ManagedPtr MenuToolButton)
- class (GObject o, IsDescendantOf MenuToolButton o) => IsMenuToolButton o
- toMenuToolButton :: (MonadIO m, IsMenuToolButton o) => o -> m MenuToolButton
- noMenuToolButton :: Maybe MenuToolButton
- menuToolButtonGetMenu :: (HasCallStack, MonadIO m, IsMenuToolButton a) => a -> m Widget
- menuToolButtonNew :: (HasCallStack, MonadIO m, IsWidget a) => Maybe a -> Maybe Text -> m MenuToolButton
- menuToolButtonNewFromStock :: (HasCallStack, MonadIO m) => Text -> m MenuToolButton
- menuToolButtonSetArrowTooltipMarkup :: (HasCallStack, MonadIO m, IsMenuToolButton a) => a -> Text -> m ()
- menuToolButtonSetArrowTooltipText :: (HasCallStack, MonadIO m, IsMenuToolButton a) => a -> Text -> m ()
- menuToolButtonSetMenu :: (HasCallStack, MonadIO m, IsMenuToolButton a, IsWidget b) => a -> b -> m ()
- clearMenuToolButtonMenu :: (MonadIO m, IsMenuToolButton o) => o -> m ()
- constructMenuToolButtonMenu :: (IsMenuToolButton o, IsMenu a) => a -> IO (GValueConstruct o)
- getMenuToolButtonMenu :: (MonadIO m, IsMenuToolButton o) => o -> m (Maybe Menu)
- setMenuToolButtonMenu :: (MonadIO m, IsMenuToolButton o, IsMenu a) => o -> a -> m ()
- type C_MenuToolButtonShowMenuCallback = Ptr () -> Ptr () -> IO ()
- type MenuToolButtonShowMenuCallback = IO ()
- afterMenuToolButtonShowMenu :: (IsMenuToolButton a, MonadIO m) => a -> MenuToolButtonShowMenuCallback -> m SignalHandlerId
- genClosure_MenuToolButtonShowMenu :: MonadIO m => MenuToolButtonShowMenuCallback -> m (GClosure C_MenuToolButtonShowMenuCallback)
- mk_MenuToolButtonShowMenuCallback :: C_MenuToolButtonShowMenuCallback -> IO (FunPtr C_MenuToolButtonShowMenuCallback)
- noMenuToolButtonShowMenuCallback :: Maybe MenuToolButtonShowMenuCallback
- onMenuToolButtonShowMenu :: (IsMenuToolButton a, MonadIO m) => a -> MenuToolButtonShowMenuCallback -> m SignalHandlerId
- wrap_MenuToolButtonShowMenuCallback :: MenuToolButtonShowMenuCallback -> C_MenuToolButtonShowMenuCallback
Exported types
newtype MenuToolButton Source #
Memory-managed wrapper type.
Instances
Eq MenuToolButton Source # | |
Defined in GI.Gtk.Objects.MenuToolButton (==) :: MenuToolButton -> MenuToolButton -> Bool # (/=) :: MenuToolButton -> MenuToolButton -> Bool # | |
IsGValue MenuToolButton Source # | Convert |
Defined in GI.Gtk.Objects.MenuToolButton toGValue :: MenuToolButton -> IO GValue # fromGValue :: GValue -> IO MenuToolButton # | |
GObject MenuToolButton Source # | |
Defined in GI.Gtk.Objects.MenuToolButton gobjectType :: IO GType # | |
HasParentTypes MenuToolButton Source # | |
Defined in GI.Gtk.Objects.MenuToolButton | |
type ParentTypes MenuToolButton Source # | |
Defined in GI.Gtk.Objects.MenuToolButton type ParentTypes MenuToolButton = '[ToolButton, ToolItem, Bin, Container, Widget, Object, ImplementorIface, Actionable, Activatable, Buildable] |
class (GObject o, IsDescendantOf MenuToolButton o) => IsMenuToolButton o Source #
Type class for types which can be safely cast to MenuToolButton
, for instance with toMenuToolButton
.
Instances
(GObject o, IsDescendantOf MenuToolButton o) => IsMenuToolButton o Source # | |
Defined in GI.Gtk.Objects.MenuToolButton |
toMenuToolButton :: (MonadIO m, IsMenuToolButton o) => o -> m MenuToolButton Source #
Cast to MenuToolButton
, for types for which this is known to be safe. For general casts, use castTo
.
noMenuToolButton :: Maybe MenuToolButton Source #
A convenience alias for Nothing
:: Maybe
MenuToolButton
.
Methods
Overloaded methods
getMenu
menuToolButtonGetMenu Source #
:: (HasCallStack, MonadIO m, IsMenuToolButton a) | |
=> a |
|
-> m Widget | Returns: the |
Gets the Menu
associated with MenuToolButton
.
Since: 2.6
new
:: (HasCallStack, MonadIO m, IsWidget a) | |
=> Maybe a |
|
-> Maybe Text |
|
-> m MenuToolButton | Returns: the new |
Creates a new MenuToolButton
using iconWidget
as icon and
label
as label.
Since: 2.6
newFromStock
menuToolButtonNewFromStock Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m MenuToolButton | Returns: the new |
Deprecated: (Since version 3.10)Use menuToolButtonNew
instead.
Creates a new MenuToolButton
.
The new MenuToolButton
will contain an icon and label from
the stock item indicated by stockId
.
Since: 2.6
setArrowTooltipMarkup
menuToolButtonSetArrowTooltipMarkup Source #
:: (HasCallStack, MonadIO m, IsMenuToolButton a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the tooltip markup text to be used as tooltip for the arrow button
which pops up the menu. See toolItemSetTooltipText
for setting
a tooltip on the whole MenuToolButton
.
Since: 2.12
setArrowTooltipText
menuToolButtonSetArrowTooltipText Source #
:: (HasCallStack, MonadIO m, IsMenuToolButton a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the tooltip text to be used as tooltip for the arrow button which
pops up the menu. See toolItemSetTooltipText
for setting a tooltip
on the whole MenuToolButton
.
Since: 2.12
setMenu
menuToolButtonSetMenu Source #
:: (HasCallStack, MonadIO m, IsMenuToolButton a, IsWidget b) | |
=> a |
|
-> b |
|
-> m () |
Sets the Menu
that is popped up when the user clicks on the arrow.
If menu
is NULL, the arrow button becomes insensitive.
Since: 2.6
Properties
menu
No description available in the introspection data.
clearMenuToolButtonMenu :: (MonadIO m, IsMenuToolButton o) => o -> m () Source #
Set the value of the “menu
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#menu
constructMenuToolButtonMenu :: (IsMenuToolButton o, IsMenu a) => a -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “menu
” property. This is rarely needed directly, but it is used by new
.
getMenuToolButtonMenu :: (MonadIO m, IsMenuToolButton o) => o -> m (Maybe Menu) Source #
Get the value of the “menu
” property.
When overloading is enabled, this is equivalent to
get
menuToolButton #menu
setMenuToolButtonMenu :: (MonadIO m, IsMenuToolButton o, IsMenu a) => o -> a -> m () Source #
Set the value of the “menu
” property.
When overloading is enabled, this is equivalent to
set
menuToolButton [ #menu:=
value ]
Signals
showMenu
type C_MenuToolButtonShowMenuCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type MenuToolButtonShowMenuCallback = IO () Source #
The showMenu signal is emitted before the menu is shown.
It can be used to populate the menu on demand, using
menuToolButtonSetMenu
.
Note that even if you populate the menu dynamically in this way,
you must set an empty menu on the MenuToolButton
beforehand,
since the arrow is made insensitive if the menu is not set.
afterMenuToolButtonShowMenu :: (IsMenuToolButton a, MonadIO m) => a -> MenuToolButtonShowMenuCallback -> m SignalHandlerId Source #
Connect a signal handler for the showMenu signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
menuToolButton #showMenu callback
genClosure_MenuToolButtonShowMenu :: MonadIO m => MenuToolButtonShowMenuCallback -> m (GClosure C_MenuToolButtonShowMenuCallback) Source #
Wrap the callback into a GClosure
.
mk_MenuToolButtonShowMenuCallback :: C_MenuToolButtonShowMenuCallback -> IO (FunPtr C_MenuToolButtonShowMenuCallback) Source #
Generate a function pointer callable from C code, from a C_MenuToolButtonShowMenuCallback
.
noMenuToolButtonShowMenuCallback :: Maybe MenuToolButtonShowMenuCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MenuToolButtonShowMenuCallback
onMenuToolButtonShowMenu :: (IsMenuToolButton a, MonadIO m) => a -> MenuToolButtonShowMenuCallback -> m SignalHandlerId Source #
Connect a signal handler for the showMenu signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
menuToolButton #showMenu callback