From: Duncan C. <dun...@us...> - 2004-08-03 02:59:05
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/menuComboToolbar In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29523/gtk/menuComboToolbar Modified Files: CheckMenuItem.chs RadioMenuItem.chs api.ignore Log Message: Add missing functions. Also tidy up documentation a bit. Exclude deprecated and internal radio_menu_item and toolbar functions. Index: CheckMenuItem.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/menuComboToolbar/CheckMenuItem.chs,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- CheckMenuItem.chs 30 Jul 2004 16:38:54 -0000 1.7 +++ CheckMenuItem.chs 3 Aug 2004 02:58:26 -0000 1.8 @@ -34,6 +34,7 @@ checkMenuItemNewWithMnemonic, checkMenuItemSetActive, checkMenuItemGetActive, + checkMenuItemToggled, checkMenuItemSetInconsistent, checkMenuItemGetInconsistent #if GTK_CHECK_VERSION(2,4,0) @@ -87,6 +88,12 @@ checkMenuItemGetActive mi = liftM toBool $ {#call unsafe check_menu_item_get_active#} (toCheckMenuItem mi) +-- | Emits the toggled signal. +-- +checkMenuItemToggled :: CheckMenuItemClass mi => mi -> IO () +checkMenuItemToggled mi = + {#call check_menu_item_toggled#} (toCheckMenuItem mi) + -- | Set the state of the menu item check to \`inconsistent'. -- checkMenuItemSetInconsistent :: CheckMenuItemClass mi => mi -> Bool -> IO () Index: RadioMenuItem.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/menuComboToolbar/RadioMenuItem.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- RadioMenuItem.chs 23 May 2004 16:05:21 -0000 1.4 +++ RadioMenuItem.chs 3 Aug 2004 02:58:26 -0000 1.5 @@ -33,8 +33,15 @@ castToRadioMenuItem, radioMenuItemNew, radioMenuItemNewWithLabel, + radioMenuItemNewWithMnemonic, radioMenuItemNewJoinGroup, - radioMenuItemNewJoinGroupWithLabel + radioMenuItemNewJoinGroupWithLabel, + radioMenuItemNewJoinGroupWithMnemonic, + + -- * Compatibilty aliases + radioMenuItemNewFromWidget, + radioMenuItemNewWithLabelFromWidget, + radioMenuItemNewWithMnemonicFromWidget ) where import Monad (liftM) @@ -54,16 +61,23 @@ radioMenuItemNew = makeNewObject mkRadioMenuItem $ liftM castPtr $ {#call unsafe radio_menu_item_new#} nullPtr --- | Create a new radio menu item with a --- label in it. +-- | Create a new radio menu item with a label in it. -- radioMenuItemNewWithLabel :: String -> IO RadioMenuItem radioMenuItemNewWithLabel label = withUTFString label $ \strPtr -> makeNewObject mkRadioMenuItem $ liftM castPtr $ {#call unsafe radio_menu_item_new_with_label#} nullPtr strPtr --- | Create a new radio button and attach it --- to the group of another radio button. +-- | Create a new radio menu item with a label in it. Underscores in the label +-- string indicate the mnemonic for the menu item. +-- +radioMenuItemNewWithMnemonic :: String -> IO RadioMenuItem +radioMenuItemNewWithMnemonic label = withUTFString label $ \strPtr -> + makeNewObject mkRadioMenuItem $ liftM castPtr $ + {#call unsafe radio_menu_item_new_with_mnemonic#} nullPtr strPtr + +-- | Create a new radio button and attach it to the group of another radio +-- button. -- radioMenuItemNewJoinGroup :: RadioMenuItem -> IO RadioMenuItem radioMenuItemNewJoinGroup rmi = do @@ -71,8 +85,8 @@ makeNewObject mkRadioMenuItem $ liftM castPtr $ {#call unsafe radio_menu_item_new#} groupPtr --- | Create a new radio button with --- a label and attach it to the group of another radio button. +-- | Create a new radio button with a label and attach it to the group of +-- another radio button. -- radioMenuItemNewJoinGroupWithLabel :: RadioMenuItem -> String -> IO RadioMenuItem @@ -82,3 +96,26 @@ makeNewObject mkRadioMenuItem $ liftM castPtr $ {#call unsafe radio_menu_item_new_with_label#} groupPtr strPtr +-- | Create a new radio button with a label and attach it to the group of +-- another radio button. Underscores in the label string indicate the mnemonic +-- for the menu item. +-- +radioMenuItemNewJoinGroupWithMnemonic :: RadioMenuItem -> String -> + IO RadioMenuItem +radioMenuItemNewJoinGroupWithMnemonic rmi label = do + groupPtr <- {#call unsafe radio_menu_item_get_group#} rmi + withUTFString label $ \strPtr -> + makeNewObject mkRadioMenuItem $ liftM castPtr $ + {#call unsafe radio_menu_item_new_with_mnemonic#} groupPtr strPtr + +-- These were added in gtk 2.4, the above Join methods simulate them in earlier +-- versions. These aliases are here for compatibility. + +-- | Alias for 'radioMenuItemNewJoinGroup'. +radioMenuItemNewFromWidget = radioMenuItemNewJoinGroup + +-- | Alias for 'radioMenuItemNewJoinGroupWithLabel'. +radioMenuItemNewWithLabelFromWidget = radioMenuItemNewJoinGroupWithLabel + +-- | Alias for 'radioMenuItemNewJoinGroupWithMnemonic'. +radioMenuItemNewWithMnemonicFromWidget = radioMenuItemNewJoinGroupWithMnemonic Index: api.ignore =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/menuComboToolbar/api.ignore,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- api.ignore 30 Jul 2004 16:46:56 -0000 1.1 +++ api.ignore 3 Aug 2004 02:58:26 -0000 1.2 @@ -2,5 +2,21 @@ #deprecated exclude gtk_check_menu_item_set_show_toggle -#emits the signal, seems internal -exclude gtk_check_menu_item_toggled +#deprecated toolbar stuff +exclude gtk_toolbar_unset_icon_size +exclude gtk_toolbar_set_icon_size +exclude gtk_toolbar_remove_space +exclude gtk_toolbar_(append|prepend|insert)_(item|space|element|widget)$ +exclude gtk_toolbar_insert_stock + +#radio menu item stuff +#this one is not used +exclude gtk_radio_menu_item_set_group + +#these are not bound because they are implemented in Haskell +exclude gtk_radio_menu_item_new_from_widget +exclude gtk_radio_menu_item_new_with_label_from_widget + +#rather internal menu item stuff +exclude gtk_menu_item_toggle_size_request +exclude gtk_menu_item_toggle_size_allocate |