Name

Toolbar —

Toolbar: create bars of buttons and derived widget. Buttons, RadioButtons and ToggleButtons can be added by refering to stock images. Their size can be changed by calling toolbarSetIconSize. In contrast, normal widget cannot be added. Due to the bad interface of GtkToolbar Mnemonics of RadioButtons and ToggleButtons are not honored.

Synopsis

toolbarNew:: IO Toolbar
toolbarAppendNewButton:: ToolbarClass tb => tb -> String -> Maybe (String,String) -> IO Button
toolbarAppendNewRadioButton:: (ToolbarClass tb, RadioButtonClass rb) => tb -> String -> Maybe (String,String) -> Maybe rb -> IO RadioButton
toolbarAppendNewToggleButton:: ToolbarClass tb => tb -> String -> Maybe (String,String) -> IO ToggleButton
toolbarAppendNewWidget:: (ToolbarClass tb, WidgetClass w) => tb -> w -> Maybe (String,String) -> IO ()
toolbarGetIconSize:: ToolbarClass tb => tb -> IO IconSize
toolbarInsertNewButton:: ToolbarClass tb => tb -> Int -> String -> Maybe (String,String) -> IO Button
toolbarInsertNewRadioButton:: (ToolbarClass tb, RadioButtonClass rb) => tb -> Int -> String -> Maybe (String,String) -> Maybe rb -> IO RadioButton
toolbarInsertNewToggleButton:: ToolbarClass tb => tb -> Int -> String -> Maybe (String,String) -> IO ToggleButton
toolbarInsertNewWidget:: (ToolbarClass tb, WidgetClass w) => tb -> Int -> w -> Maybe (String,String) -> IO ()
toolbarPrependNewButton:: ToolbarClass tb => tb -> String -> Maybe (String,String) -> IO Button
toolbarPrependNewRadioButton:: (ToolbarClass tb, RadioButtonClass rb) => tb -> String -> Maybe (String,String) -> Maybe rb -> IO RadioButton
toolbarPrependNewToggleButton:: ToolbarClass tb => tb -> String -> Maybe (String,String) -> IO ToggleButton
toolbarPrependNewWidget:: (ToolbarClass tb, WidgetClass w) => tb -> w -> Maybe (String,String) -> IO ()
toolbarSetIconSize:: ToolbarClass tb => tb -> IconSize -> IO ()
toolbarSetOrientation:: ToolbarClass tb => tb -> Orientation -> IO ()
toolbarSetStyle:: ToolbarClass tb => tb -> ToolbarStyle -> IO ()
toolbarSetTooltips:: ToolbarClass tb => tb -> Bool -> IO ()
onOrientationChanged:: ToolbarClass tb => tb -> (Orientation -> IO ()) -> IO (ConnectId tb)
onStyleChanged:: ToolbarClass tb => tb -> (ToolbarStyle -> IO ()) -> IO (ConnectId tb)

Introduction

All the append, insert and prepend functions use an internal function to do the actual work. In fact the interface is pretty skrewed up: To insert icons by using stock items is definitely the best practice as all other images cannot react to toolbarSetIconSize and other theming actions. On the other hand toolbar_insert_stock() always generates simple Buttons but is the only function that is able to insert Mnemonics on the label. Our solution is to use StockItems to specify all Images of the Buttons. If the user inserts RadioButtons or ToggleButtons, the stock image lookup is done manually. A mnemonic in the labels is sadly not honored this way.

Constructors

toolbarNew

Create a new, empty toolbar.

toolbarNew

Methods

toolbarAppendNewButton

Append a new Button to the Toolbar.

toolbarAppendNewButton:: tb:: String:: Maybe (String,String):: IO Button
tb  

See toolbarInsertNewButton for details.

toolbarAppendNewRadioButton

Append a new RadioButton to the Toolbar.

toolbarAppendNewRadioButton:: tb:: String:: Maybe (String,String):: Maybe rb:: IO RadioButton
tb   

See toolbarInsertNewButton for details.

Mnemonics in the label of the StockItem are removed as they do not work due to the bad interface definition of GtkToolbar.

toolbarAppendNewToggleButton

Append a new ToggleButton to the Toolbar.

toolbarAppendNewToggleButton:: tb:: String:: Maybe (String,String):: IO ToggleButton
tb  

See toolbarInsertNewButton for details.

Mnemonics in the label of the StockItem are removed as they do not work due to the bad interface definition of GtkToolbar.

toolbarAppendNewWidget

Append a new Widget to the Toolbar.

toolbarAppendNewWidget:: tb:: w:: Maybe (String,String):: IO ()
tb  

See toolbarInsertNewButton for details.

Mnemonics in the label of the StockItem are removed as they do not work due to the bad interface definition of GtkToolbar.

toolbarGetIconSize

Retrieve the current icon size that the Toolbar shows.

toolbarGetIconSize:: tb:: IO IconSize
tb

toolbarInsertNewButton

Insert a new Button into the Toolbar.

toolbarInsertNewButton:: tb:: Int:: String:: Maybe (String,String):: IO Button
tbposstockIdtooltips

The new Button is created at position pos, counting from 0.

The icon and label for the button is referenced by stockId which must be a valid entry in the Toolbars Style or the default IconFactory.

If you whish to have Tooltips added to this button you can specify Just (tipText, tipPrivate) , otherwise specify Nothing.

The newly created Button is returned. Use this button to add an action function with onClicked.

toolbarInsertNewRadioButton

Insert a new RadioButton into the Toolbar.

toolbarInsertNewRadioButton:: tb:: Int:: String:: Maybe (String,String):: Maybe rb:: IO RadioButton
tbposstockIdtooltipsrb

See toolbarInsertNewButton for details.

Mnemonics in the label of the StockItem are removed as they do not work due to the bad interface definition of GtkToolbar.

The parent argument must be set to another RadioButton in the group. If Nothing is given, a new group is generated (which is the desired behavious for the first button of a group).

toolbarInsertNewToggleButton

Insert a new ToggleButton into the Toolbar.

toolbarInsertNewToggleButton:: tb:: Int:: String:: Maybe (String,String):: IO ToggleButton
tbposstockIdtooltips

See toolbarInsertNewButton for details.

Mnemonics in the label of the StockItem are removed as they do not work due to the bad interface definition of GtkToolbar.

toolbarInsertNewWidget

Insert an arbitrary widget to the Toolbar.

toolbarInsertNewWidget:: tb:: Int:: w:: Maybe (String,String):: IO ()
tbposwtooltips

The Widget should not be a button. Adding Buttons with the toolbarInsertButton,... functions with stock objects is much better as it takes care of theme handling.

toolbarPrependNewButton

Prepend a new Button to the Toolbar.

toolbarPrependNewButton:: tb:: String:: Maybe (String,String):: IO Button
tb  

See toolbarInsertNewButton for details.

toolbarPrependNewRadioButton

Prepend a new RadioButton to the Toolbar.

toolbarPrependNewRadioButton:: tb:: String:: Maybe (String,String):: Maybe rb:: IO RadioButton
tb   

See toolbarInsertNewButton for details.

Mnemonics in the label of the StockItem are removed as they do not work due to the bad interface definition of GtkToolbar.

toolbarPrependNewToggleButton

Prepend a new ToggleButton to the Toolbar.

toolbarPrependNewToggleButton:: tb:: String:: Maybe (String,String):: IO ToggleButton
tb  

See toolbarInsertNewButton for details.

Mnemonics in the label of the StockItem are removed as they do not work due to the bad interface definition of GtkToolbar.

toolbarPrependNewWidget

Prepend a new Widget to the Toolbar.

toolbarPrependNewWidget:: tb:: w:: Maybe (String,String):: IO ()
tb  

See toolbarInsertNewButton for details.

Mnemonics in the label of the StockItem are removed as they do not work due to the bad interface definition of GtkToolbar.

toolbarSetIconSize

Set the size of the icons.

toolbarSetIconSize:: tb:: IconSize:: IO ()
tbis

It might be sensible to restrict oneself to IconSizeSmallToolbar and IconSizeLargeToolbar.

toolbarSetOrientation

Set the direction of the Toolbar.

toolbarSetOrientation:: tb:: Orientation:: IO ()
tborientation

toolbarSetStyle

Specify how the buttons are dispayed.

toolbarSetStyle:: tb:: ToolbarStyle:: IO ()
tbstyle

toolbarSetTooltips

Enable or disable the Tooltips.

toolbarSetTooltips:: tb:: Bool:: IO ()
tbenable

Signals

onOrientationChanged

Emitted when toolbarSetOrientation is called.

onOrientationChanged:: tb:: (Orientation -> IO ()):: IO (ConnectId tb)

onStyleChanged

Emitted when toolbarSetStyle is called.

onStyleChanged:: tb:: (ToolbarStyle -> IO ()):: IO (ConnectId tb)