gtk3-0.15.10: Binding to the Gtk+ 3 graphical user interface library

Maintainer | gtk2hs-users@lists.sourceforge.net
Stability | provisional
Portability | portable (depends on GHC)
Safe Haskell | None
Language | Haskell98

Graphics.UI.Gtk.MenuComboToolbar.Toolbar

Contents

- Detail
- Class Hierarchy
- Types
- Constructors
- Methods
- Attributes
- Child Attributes
- Signals

Description

Create bars of buttons and other widgets

Synopsis

- data Toolbar
- class ContainerClass o => ToolbarClass o
- castToToolbar :: GObjectClass obj => obj -> Toolbar
- gTypeToolbar :: GType
- toToolbar :: ToolbarClass o => o -> Toolbar
- data Orientation
  - = OrientationHorizontal
  - | OrientationVertical
- data ToolbarStyle
  - = ToolbarIcons
  - | ToolbarText
  - | ToolbarBoth
  - | ToolbarBothHoriz
- toolbarNew :: IO Toolbar
- toolbarSetStyle :: ToolbarClass self => self -> ToolbarStyle -> IO ()
- toolbarGetStyle :: ToolbarClass self => self -> IO ToolbarStyle
- toolbarUnsetStyle :: ToolbarClass self => self -> IO ()
- data IconSize
  - = IconSizeInvalid
  - | IconSizeMenu
  - | IconSizeSmallToolbar
  - | IconSizeLargeToolbar
  - | IconSizeButton
  - | IconSizeDnd
  - | IconSizeDialog
  - | IconSizeUser Int
- toolbarGetIconSize :: ToolbarClass self => self -> IO IconSize
- toolbarInsert :: (ToolbarClass self, ToolItemClass item) => self -> item -> Int -> IO ()
- toolbarGetItemIndex :: (ToolbarClass self, ToolItemClass item) => self -> item -> IO Int
- toolbarGetNItems :: ToolbarClass self => self -> IO Int
- toolbarGetNthItem :: ToolbarClass self => self -> Int -> IO (Maybe ToolItem)
- toolbarGetDropIndex :: ToolbarClass self => self -> (Int, Int) -> IO Int
- toolbarSetDropHighlightItem :: (ToolbarClass self, ToolItemClass toolItem) => self -> Maybe toolItem -> Int -> IO ()
- toolbarSetShowArrow :: ToolbarClass self => self -> Bool -> IO ()
- toolbarGetShowArrow :: ToolbarClass self => self -> IO Bool
- data ReliefStyle
  - = ReliefNormal
  - | ReliefHalf
  - | ReliefNone
- toolbarGetReliefStyle :: ToolbarClass self => self -> IO ReliefStyle
- toolbarShowArrow :: ToolbarClass self => Attr self Bool
- toolbarStyle :: ToolbarClass self => Attr self ToolbarStyle
- toolbarChildExpand :: (ToolbarClass self, WidgetClass child) => child -> Attr self Bool
- toolbarChildHomogeneous :: (ToolbarClass self, WidgetClass child) => child -> Attr self Bool
- onOrientationChanged :: ToolbarClass self => self -> (Orientation -> IO ()) -> IO (ConnectId self)
- afterOrientationChanged :: ToolbarClass self => self -> (Orientation -> IO ()) -> IO (ConnectId self)
- onStyleChanged :: ToolbarClass self => self -> (ToolbarStyle -> IO ()) -> IO (ConnectId self)
- afterStyleChanged :: ToolbarClass self => self -> (ToolbarStyle -> IO ()) -> IO (ConnectId self)
- onPopupContextMenu :: ToolbarClass self => self -> (Int -> Int -> Int -> IO Bool) -> IO (ConnectId self)
- afterPopupContextMenu :: ToolbarClass self => self -> (Int -> Int -> Int -> IO Bool) -> IO (ConnectId self)

# Detail

This widget underwent a significant overhaul in gtk 2.4 and the recommended api changed substantially. The old interface is still supported but it is not recommended.

- The following information applies to the new interface only.

A toolbar is created with a call to `toolbarNew`.

A toolbar can contain instances of a subclass of `ToolItem`. To add a `ToolItem` to the a toolbar, use `toolbarInsert`. To remove an item from the toolbar use `containerRemove`. To add a button to the toolbar, add an instance of `ToolButton`.

Toolbar items can be visually grouped by adding instances of `SeparatorToolItem` to the toolbar. If a `SeparatorToolItem` has the "expand" property set to `True` and the "draw" property set to `False` the effect is to force all following items to the end of the toolbar.

Creating a context menu for the toolbar can be done using `onPopupContextMenu`.

# Class Hierarchy

    | GObject
    | +----Object
    | +----Widget
    | +----Container
    | +----Toolbar

# Types

data Toolbar Source #

#### Instances

Instances details

Eq Toolbar Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods (==) :: Toolbar -> Toolbar -> Bool Source # (/=) :: Toolbar -> Toolbar -> Bool Source #
Ord Toolbar Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods compare :: Toolbar -> Toolbar -> Ordering Source # (<) :: Toolbar -> Toolbar -> Bool Source # (<=) :: Toolbar -> Toolbar -> Bool Source # (>) :: Toolbar -> Toolbar -> Bool Source # (>=) :: Toolbar -> Toolbar -> Bool Source # max :: Toolbar -> Toolbar -> Toolbar Source # min :: Toolbar -> Toolbar -> Toolbar Source #
GObjectClass Toolbar Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods toGObject :: Toolbar -> GObject Source # unsafeCastGObject :: GObject -> Toolbar Source #
ContainerClass Toolbar Source # |
Instance details Defined in Graphics.UI.Gtk.Types
ToolbarClass Toolbar Source # |
Instance details Defined in Graphics.UI.Gtk.Types
WidgetClass Toolbar Source # |
Instance details Defined in Graphics.UI.Gtk.Types

class ContainerClass o => ToolbarClass o Source #

#### Instances

Instances details

ToolbarClass Toolbar Source # |
Instance details Defined in Graphics.UI.Gtk.Types

castToToolbar :: GObjectClass obj => obj -> Toolbar Source #

gTypeToolbar :: GType Source #

toToolbar :: ToolbarClass o => o -> Toolbar Source #

data Orientation Source #

Orientation is good

Constructors

OrientationHorizontal |
OrientationVertical |

#### Instances

Instances details

Enum Orientation Source # |

Instance details

Defined in Graphics.UI.Gtk.General.Enums

Methods

succ :: Orientation -> Orientation Source #

pred :: Orientation -> Orientation Source #

toEnum :: Int -> Orientation Source #

fromEnum :: Orientation -> Int Source #

enumFrom :: Orientation -> [Orientation] Source #

enumFromThen :: Orientation -> Orientation -> [Orientation] Source #

enumFromTo :: Orientation -> Orientation -> [Orientation] Source #

enumFromThenTo :: Orientation -> Orientation -> Orientation -> [Orientation] Source #

Show Orientation Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums Methods showsPrec :: Int -> Orientation -> ShowS Source # show :: Orientation -> String Source # showList :: [Orientation] -> ShowS Source #
Eq Orientation Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums Methods (==) :: Orientation -> Orientation -> Bool Source # (/=) :: Orientation -> Orientation -> Bool Source #

data ToolbarStyle Source #

Where to place the toolbar?

Constructors

ToolbarIcons |
ToolbarText |
ToolbarBoth |
ToolbarBothHoriz |

#### Instances

Instances details

Enum ToolbarStyle Source # |

Instance details

Defined in Graphics.UI.Gtk.General.Enums

Methods

succ :: ToolbarStyle -> ToolbarStyle Source #

pred :: ToolbarStyle -> ToolbarStyle Source #

toEnum :: Int -> ToolbarStyle Source #

fromEnum :: ToolbarStyle -> Int Source #

enumFrom :: ToolbarStyle -> [ToolbarStyle] Source #

enumFromThen :: ToolbarStyle -> ToolbarStyle -> [ToolbarStyle] Source #

enumFromTo :: ToolbarStyle -> ToolbarStyle -> [ToolbarStyle] Source #

enumFromThenTo :: ToolbarStyle -> ToolbarStyle -> ToolbarStyle -> [ToolbarStyle] Source #

Show ToolbarStyle Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums Methods showsPrec :: Int -> ToolbarStyle -> ShowS Source # show :: ToolbarStyle -> String Source # showList :: [ToolbarStyle] -> ShowS Source #
Eq ToolbarStyle Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums Methods (==) :: ToolbarStyle -> ToolbarStyle -> Bool Source # (/=) :: ToolbarStyle -> ToolbarStyle -> Bool Source #

# Constructors

toolbarNew :: IO Toolbar Source #

Creates a new toolbar.

# Methods

toolbarSetStyle :: ToolbarClass self => self -> ToolbarStyle -> IO () Source #

Alters the view of the toolbar to display either icons only, text only, or both.

toolbarGetStyle :: ToolbarClass self => self -> IO ToolbarStyle Source #

Retrieves whether the toolbar has text, icons, or both. See `toolbarSetStyle`.

toolbarUnsetStyle :: ToolbarClass self => self -> IO () Source #

Unsets a toolbar style set with `toolbarSetStyle`, so that user preferences will be used to determine the toolbar style.

data IconSize Source #

The size of an icon in pixels.

- This enumeration contains one case that is not exported and which is used when new sizes are registered using `iconSizeRegister`.
- Applying `show` to this type will reveal the name of the size that is registered with Gtk+.

Constructors

IconSizeInvalid | Don't scale but use any of the available sizes.
IconSizeMenu | Icon size to use in next to menu items in drop-down menus.
IconSizeSmallToolbar | Icon size for small toolbars.
IconSizeLargeToolbar | Icon size for larger toolbars.
IconSizeButton | Icon size for icons in buttons, next to the label.
IconSizeDnd | Icon size for icons in drag-and-drop.
IconSizeDialog | Icon size for icons next to dialog text.
IconSizeUser Int |

#### Instances

Instances details

Enum IconSize Source # |

Instance details

Defined in Graphics.UI.Gtk.General.Structs

Methods

succ :: IconSize -> IconSize Source #

pred :: IconSize -> IconSize Source #

toEnum :: Int -> IconSize Source #

fromEnum :: IconSize -> Int Source #

enumFrom :: IconSize -> [IconSize] Source #

enumFromThen :: IconSize -> IconSize -> [IconSize] Source #

enumFromTo :: IconSize -> IconSize -> [IconSize] Source #

enumFromThenTo :: IconSize -> IconSize -> IconSize -> [IconSize] Source #

Show IconSize Source # |
Instance details Defined in Graphics.UI.Gtk.General.IconFactory Methods showsPrec :: Int -> IconSize -> ShowS Source # show :: IconSize -> String Source # showList :: [IconSize] -> ShowS Source #
Eq IconSize Source # |
Instance details Defined in Graphics.UI.Gtk.General.Structs Methods (==) :: IconSize -> IconSize -> Bool Source # (/=) :: IconSize -> IconSize -> Bool Source #

toolbarGetIconSize :: ToolbarClass self => self -> IO IconSize Source #

Retrieves the icon size for the toolbar. See `toolbarSetIconSize`.

toolbarInsert Source #

Arguments

:: (ToolbarClass self, ToolItemClass item) |
=> self |
-> item | `item` - a `ToolItem`
-> Int | `pos` - the position of the new item
-> IO () |

Insert a `ToolItem` into the toolbar at position `pos`. If `pos` is 0 the item is prepended to the start of the toolbar. If `pos` is negative, the item is appended to the end of the toolbar.

- Available since Gtk version 2.4

toolbarGetItemIndex Source #

Arguments

:: (ToolbarClass self, ToolItemClass item) |
=> self |
-> item | `item` - a `ToolItem` that is a child of `toolbar`
-> IO Int | returns the position of item on the toolbar.

Returns the position of `item` on the toolbar, starting from 0. It is an error if `item` is not a child of the toolbar.

- Available since Gtk version 2.4

toolbarGetNItems :: ToolbarClass self => self -> IO Int Source #

Returns the number of items on the toolbar.

- Available since Gtk version 2.4

toolbarGetNthItem Source #

Arguments

:: ToolbarClass self |
=> self |
-> Int | `n` - A position on the toolbar
-> IO (Maybe ToolItem) | returns The `n`'th `ToolItem` on the toolbar, or `Nothing` if there isn't an `n`'th item.

Returns the `n`'th item on toolbar, or `Nothing` if the toolbar does not contain an `n`'th item.

- Available since Gtk+ version 2.4

toolbarGetDropIndex Source #

Arguments

:: ToolbarClass self |
=> self |
-> (Int, Int) | `(x, y)` - coordinate of a point on the toolbar. Note that `(x, y)` are in toolbar coordinates, not window coordinates.
-> IO Int | returns The position corresponding to the point `(x, y)` on the toolbar.

Returns the position corresponding to the indicated point on toolbar. This is useful when dragging items to the toolbar: this function returns the position a new item should be inserted.

- Available since Gtk version 2.4

toolbarSetDropHighlightItem Source #

Arguments

:: (ToolbarClass self, ToolItemClass toolItem) |
=> self |
-> Maybe toolItem | `toolItem` - a `ToolItem`, or `Nothing` to turn of highlighting
-> Int | `index` - a position on the toolbar
-> IO () |

Highlights the toolbar to give an idea of what it would look like if `item` was added to toolbar at the position indicated by `index`. If `item` is `Nothing`, highlighting is turned off (and the index is ignored).

The `toolItem` passed to this function must not be part of any widget hierarchy. When an item is set as a drop highlight item it can not added to any widget hierarchy or used as highlight item for another toolbar.

- Available since Gtk version 2.4

toolbarSetShowArrow :: ToolbarClass self => self -> Bool -> IO () Source #

Sets whether to show an overflow menu when the toolbar doesn't have room for all items on it. If `True`, items that there are not room are available through an overflow menu.

- Available since Gtk version 2.4

toolbarGetShowArrow :: ToolbarClass self => self -> IO Bool Source #

Returns whether the toolbar has an overflow menu. See `toolbarSetShowArrow`.

- Available since Gtk+ version 2.4

data ReliefStyle Source #

I don't have a clue.

Constructors

ReliefNormal |
ReliefHalf |
ReliefNone |

#### Instances

Instances details

Enum ReliefStyle Source # |

Instance details

Defined in Graphics.UI.Gtk.General.Enums

Methods

succ :: ReliefStyle -> ReliefStyle Source #

pred :: ReliefStyle -> ReliefStyle Source #

toEnum :: Int -> ReliefStyle Source #

fromEnum :: ReliefStyle -> Int Source #

enumFrom :: ReliefStyle -> [ReliefStyle] Source #

enumFromThen :: ReliefStyle -> ReliefStyle -> [ReliefStyle] Source #

enumFromTo :: ReliefStyle -> ReliefStyle -> [ReliefStyle] Source #

enumFromThenTo :: ReliefStyle -> ReliefStyle -> ReliefStyle -> [ReliefStyle] Source #

Show ReliefStyle Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums Methods showsPrec :: Int -> ReliefStyle -> ShowS Source # show :: ReliefStyle -> String Source # showList :: [ReliefStyle] -> ShowS Source #
Eq ReliefStyle Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums Methods (==) :: ReliefStyle -> ReliefStyle -> Bool Source # (/=) :: ReliefStyle -> ReliefStyle -> Bool Source #

toolbarGetReliefStyle :: ToolbarClass self => self -> IO ReliefStyle Source #

Returns the relief style of buttons on the toolbar. See `buttonSetRelief`.

- Available since Gtk+ version 2.4

# Attributes

toolbarShowArrow :: ToolbarClass self => Attr self Bool Source #

If an arrow should be shown if the toolbar doesn't fit.

Default value: `True`

toolbarStyle :: ToolbarClass self => Attr self ToolbarStyle Source #

How to draw the toolbar.

Default value: `ToolbarIcons`

# Child Attributes

toolbarChildExpand :: (ToolbarClass self, WidgetClass child) => child -> Attr self Bool Source #

Whether the item should receive extra space when the toolbar grows.

Default value: `True`

toolbarChildHomogeneous :: (ToolbarClass self, WidgetClass child) => child -> Attr self Bool Source #

Whether the item should be the same size as other homogeneous items.

Default value: `True`

# Signals

onOrientationChanged :: ToolbarClass self => self -> (Orientation -> IO ()) -> IO (ConnectId self) Source #

Emitted when the orientation of the toolbar changes.

afterOrientationChanged :: ToolbarClass self => self -> (Orientation -> IO ()) -> IO (ConnectId self) Source #

Emitted when the orientation of the toolbar changes.

onStyleChanged :: ToolbarClass self => self -> (ToolbarStyle -> IO ()) -> IO (ConnectId self) Source #

Emitted when the style of the toolbar changes.

afterStyleChanged :: ToolbarClass self => self -> (ToolbarStyle -> IO ()) -> IO (ConnectId self) Source #

Emitted when the style of the toolbar changes.

onPopupContextMenu Source #

Arguments

:: ToolbarClass self |
=> self |
-> (Int -> Int -> Int -> IO Bool) | `(x y button -> ...)` - The handler should return True if the signal was handled, False if not.
-> IO (ConnectId self) |

Emitted when the user right-clicks the toolbar or uses the keybinding to display a popup menu.

Application developers should handle this signal if they want to display a context menu on the toolbar. The context-menu should appear at the coordinates given by `x` and `y`. The mouse button number is given by the `button` parameter. If the menu was popped up using the keyboard, `button` is -1.

afterPopupContextMenu Source #

Arguments

:: ToolbarClass self |
=> self |
-> (Int -> Int -> Int -> IO Bool) | `(x y button -> ...)` - The handler should return True if the signal was handled, False if not.
-> IO (ConnectId self) |

Emitted when the user right-clicks the toolbar or uses the keybinding to display a popup menu.

Application developers should handle this signal if they want to display a context menu on the toolbar. The context-menu should appear at the coordinates given by `x` and `y`. The mouse button number is given by the `button` parameter. If the menu was popped up using the keyboard, `button` is -1.