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.
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) |
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.
Append a new Button to the Toolbar.
| toolbarAppendNewButton | :: tb | :: String | :: Maybe (String,String) | :: IO Button |
| tb |
See toolbarInsertNewButton for details.
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.
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.
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.
Retrieve the current icon size that the Toolbar shows.
| toolbarGetIconSize | :: tb | :: IO IconSize |
| tb |
Insert a new Button into the Toolbar.
| toolbarInsertNewButton | :: tb | :: Int | :: String | :: Maybe (String,String) | :: IO Button |
| tb | pos | stockId | tooltips |
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.
Insert a new RadioButton into the Toolbar.
| toolbarInsertNewRadioButton | :: tb | :: Int | :: String | :: Maybe (String,String) | :: Maybe rb | :: IO RadioButton |
| tb | pos | stockId | tooltips | rb |
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).
Insert a new ToggleButton into the Toolbar.
| toolbarInsertNewToggleButton | :: tb | :: Int | :: String | :: Maybe (String,String) | :: IO ToggleButton |
| tb | pos | stockId | tooltips |
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.
Insert an arbitrary widget to the Toolbar.
| toolbarInsertNewWidget | :: tb | :: Int | :: w | :: Maybe (String,String) | :: IO () |
| tb | pos | w | tooltips |
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.
Prepend a new Button to the Toolbar.
| toolbarPrependNewButton | :: tb | :: String | :: Maybe (String,String) | :: IO Button |
| tb |
See toolbarInsertNewButton for details.
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.
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.
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.
Set the size of the icons.
| toolbarSetIconSize | :: tb | :: IconSize | :: IO () |
| tb | is |
It might be sensible to restrict oneself to IconSizeSmallToolbar and IconSizeLargeToolbar.
Set the direction of the Toolbar.
| toolbarSetOrientation | :: tb | :: Orientation | :: IO () |
| tb | orientation |