From: Duncan C. <dun...@us...> - 2005-02-25 01:12:15
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/MenuComboToolbar In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24163/gtk/Graphics/UI/Gtk/MenuComboToolbar Modified Files: CheckMenuItem.chs.pp Combo.chs.pp ComboBox.chs.pp ComboBoxEntry.chs.pp ImageMenuItem.chs Menu.chs.pp MenuBar.chs MenuItem.chs MenuShell.chs OptionMenu.chs.pp RadioMenuItem.chs TearoffMenuItem.chs ToolItem.chs.pp Toolbar.chs.pp Log Message: Add more module level documentation and tidy up exiting documentation. Also add/modify section headers. Also LGPL'ify remaining modules with permission from Matthew Walton. Index: Menu.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/MenuComboToolbar/Menu.chs.pp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Menu.chs.pp 12 Feb 2005 17:19:23 -0000 1.2 +++ Menu.chs.pp 25 Feb 2005 01:11:34 -0000 1.3 @@ -19,6 +19,16 @@ -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- Lesser General Public License for more details. -- +-- TODO +-- +-- The following not bound functions might be useful: +-- menuSetAccelGroup, menuSetAccelGroup, menuReposition +-- +-- The function menuPopup at a specific position is difficult to bind: +-- The callback function that determines at which position the menu is +-- to be shown is keept after the call returns. Maybe we could destroy +-- this function pointer with a destory event? +-- -- | -- Maintainer : gtk...@li... -- Stability : provisional @@ -28,21 +38,42 @@ -- are two kinds: Those that are part of a 'MenuBar' and those -- that appear as a context menu (within the work space). -- --- TODO +module Graphics.UI.Gtk.MenuComboToolbar.Menu ( +-- * Description +-- +-- | A 'Menu' is a 'MenuShell' that implements a drop down menu consisting of +-- a list of 'MenuItem' objects which can be navigated and activated by the +-- user to perform application functions. -- --- * The following not bound functions might be useful: --- menuSetAccelGroup, menuSetAccelGroup, menuReposition +-- A 'Menu' is most commonly dropped down by activating a 'MenuItem' in a +-- 'MenuBar' or popped up by activating a 'MenuItem' in another 'Menu'. -- --- * The function menuPopup at a specific position is difficult to bind: --- The callback function that determines at which position the menu is --- to be shown is keept after the call returns. Maybe we could destroy --- this function pointer with a destory event? +-- A 'Menu' can also be popped up by activating a 'OptionMenu'. Other +-- composite widgets such as the 'Notebook' can pop up a 'Menu' as well. -- -module Graphics.UI.Gtk.MenuComboToolbar.Menu ( +-- Applications can display a 'Menu' as a popup menu by calling the +-- 'menuPopup' function. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Container' +-- | +----'MenuShell' +-- | +----Menu +-- @ + +-- * Types Menu, MenuClass, castToMenu, + +-- * Constructors menuNew, + +-- * Methods menuReorderChild, menuPopup, menuSetAccelGroup, @@ -80,7 +111,8 @@ {# context lib="gtk" prefix="gtk" #} --- methods +-------------------- +-- Constructors -- | Make an empty Menu. -- @@ -88,6 +120,9 @@ menuNew = makeNewObject mkMenu $ liftM castPtr {#call unsafe menu_new#} +-------------------- +-- Methods + -- | Move a child to a new position within the menu. -- -- * The position is counted from 0 to n-1 if the menu contains n entries. Index: ToolItem.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/MenuComboToolbar/ToolItem.chs.pp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ToolItem.chs.pp 12 Feb 2005 17:19:23 -0000 1.2 +++ ToolItem.chs.pp 25 Feb 2005 01:11:35 -0000 1.3 @@ -24,22 +24,43 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- ToolItem is the base class of widgets that can be added to a "Toolbar". --- --- * Added in GTK+ 2.4 +-- 'ToolItem' is the base class of widgets that can be added to 'Toolbar'. -- module Graphics.UI.Gtk.MenuComboToolbar.ToolItem ( -- * Description -- --- | "ToolItem"s are widgets that can appear on a toolbar. To create a toolbar +-- | 'ToolItem's are widgets that can appear on a toolbar. To create a toolbar -- item that contain something else than a button, use 'toolItemNew'. Use -- 'containerAdd' to add a child widget to the tool item. -- --- For toolbar items that contain buttons, see the "ToolButton", --- "ToggleToolButton" and "RadioToolButton" classes. +-- For toolbar items that contain buttons, see the 'ToolButton', +-- 'ToggleToolButton' and 'RadioToolButton' classes. -- +-- * Module available since Gtk version 2.4 + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Container' +-- | +----'Bin' +-- | +----ToolItem +-- | +----'ToolButton' +-- | +----'SeparatorToolItem' +-- @ + #if GTK_CHECK_VERSION(2,4,0) +-- * Types + ToolItem, + ToolItemClass, + castToToolItem, + +-- * Constructors toolItemNew, + +-- * Methods toolItemSetHomogeneous, toolItemGetHomogeneous, toolItemSetExpand, @@ -81,12 +102,18 @@ {# context lib="gtk" prefix="gtk" #} +-------------------- +-- Constructors + -- | Creates a new "ToolItem". -- toolItemNew :: IO ToolItem toolItemNew = makeNewObject mkToolItem {#call unsafe tool_item_new#} +-------------------- +-- Methods + -- | Sets whether the tool item is to be allocated the same size as other -- homogeneous items. The effect is that all homogeneous items will have the -- same width as the widest of the items. Index: RadioMenuItem.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/MenuComboToolbar/RadioMenuItem.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- RadioMenuItem.chs 12 Feb 2005 17:19:23 -0000 1.2 +++ RadioMenuItem.chs 25 Feb 2005 01:11:35 -0000 1.3 @@ -31,9 +31,31 @@ -- widget interface. -- module Graphics.UI.Gtk.MenuComboToolbar.RadioMenuItem ( +-- * Description +-- +-- | A radio menu item is a check menu item that belongs to a group. At each +-- instant exactly one of the radio menu items from a group is selected. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Container' +-- | +----'Bin' +-- | +----'Item' +-- | +----'MenuItem' +-- | +----'CheckMenuItem' +-- | +----RadioMenuItem +-- @ + +-- * Types RadioMenuItem, RadioMenuItemClass, castToRadioMenuItem, + +-- * Constructors radioMenuItemNew, radioMenuItemNewWithLabel, radioMenuItemNewWithMnemonic, @@ -57,7 +79,8 @@ {# context lib="gtk" prefix="gtk" #} --- methods +-------------------- +-- Constructors -- | Create a new radio menu item. -- Index: MenuBar.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/MenuComboToolbar/MenuBar.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- MenuBar.chs 12 Feb 2005 17:19:23 -0000 1.2 +++ MenuBar.chs 25 Feb 2005 01:11:35 -0000 1.3 @@ -24,12 +24,33 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- A subclass widget for "MenuShell" which holds "MenuItem" widgets +-- A subclass widget for 'MenuShell' which holds 'MenuItem' widgets -- module Graphics.UI.Gtk.MenuComboToolbar.MenuBar ( +-- * Description +-- +-- | The 'MenuBar' is a subclass of 'MenuShell' which contains one to many +-- 'MenuItem'. The result is a standard menu bar which can hold many menu +-- items. 'MenuBar' allows for a shadow type to be set for aesthetic purposes. +-- The shadow types are defined in the 'menuBarSetShadowType' function. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Container' +-- | +----'MenuShell' +-- | +----MenuBar +-- @ + +-- * Types MenuBar, MenuBarClass, castToMenuBar, + +-- * Constructors menuBarNew ) where @@ -42,7 +63,8 @@ {# context lib="gtk" prefix="gtk" #} --- methods +-------------------- +-- Constructors -- | Create a horizontal bar that contains menu items. -- Index: Combo.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/MenuComboToolbar/Combo.chs.pp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Combo.chs.pp 12 Feb 2005 17:19:23 -0000 1.2 +++ Combo.chs.pp 25 Feb 2005 01:11:34 -0000 1.3 @@ -19,29 +19,56 @@ -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- Lesser General Public License for more details. -- +-- TODO +-- +-- The combo_set_item_string function is not bound as we do not handle +-- arbitrary widgets yet. +-- -- | --- Maintainer : gtk2hs-users\@lists.sourceforge.net +-- Maintainer : gtk...@li... -- Stability : provisional -- Portability : portable (depends on GHC) -- -- A Combo box is a text entry field with a drop down list of predefined -- alternatives. -- --- * The Combo widget allows to insert arbitrary widgets as alternatives. Due --- to the deprecated ListItem object we currently make no use of this --- feature. +module Graphics.UI.Gtk.MenuComboToolbar.Combo ( +-- * Description +-- +-- | The 'Combo' widget consists of a single-line text entry field and a +-- drop-down list. The drop-down list is displayed when the user clicks on a +-- small arrow button to the right of the entry field. -- --- TODO +-- List elements +-- can contain arbitrary widgets, but if an element is not a plain label, then +-- you must use the 'listSetItemString' function. This sets the string which +-- will be placed in the text entry field when the item is selected. -- --- * The combo_set_item_string function is not bound as we do not handle --- arbitrary widgets yet. +-- By default, the user can step through the items in the list using the +-- arrow (cursor) keys, though this behaviour can be turned off with +-- 'comboSetUseArrows'. -- -module Graphics.UI.Gtk.MenuComboToolbar.Combo ( +-- As of Gtk+ 2.4, 'Combo' has been deprecated in favor of 'ComboBox'. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Container' +-- | +----'Box' +-- | +----'HBox' +-- | +----Combo +-- @ #ifndef DISABLE_DEPRECATED +-- * Types Combo, ComboClass, castToCombo, comboNew, + +-- * Methods comboSetPopdownStrings, comboSetValueInList, comboSetUseArrows, @@ -65,7 +92,8 @@ {# context lib="gtk" prefix="gtk" #} --- methods +-------------------- +-- Methods -- Create a new Combo text entry field. -- Index: CheckMenuItem.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/MenuComboToolbar/CheckMenuItem.chs.pp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- CheckMenuItem.chs.pp 12 Feb 2005 17:19:23 -0000 1.2 +++ CheckMenuItem.chs.pp 25 Feb 2005 01:11:34 -0000 1.3 @@ -27,11 +27,40 @@ -- This widget implements a 'MenuItem' with a check next to it. -- module Graphics.UI.Gtk.MenuComboToolbar.CheckMenuItem ( +-- * Description +-- +-- | A 'CheckMenuItem' is a menu item that maintains the state of a boolean +-- value in addition to a 'MenuItem''s usual role in activating application +-- code. +-- +-- A check box indicating the state of the boolean value is displayed at the +-- left side of the 'MenuItem'. Activating the 'MenuItem' toggles the value. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Container' +-- | +----'Bin' +-- | +----'Item' +-- | +----'MenuItem' +-- | +----CheckMenuItem +-- | +----'RadioMenuItem' +-- @ + +-- * Types CheckMenuItem, CheckMenuItemClass, + castToCheckMenuItem, + +-- * Constructors checkMenuItemNew, checkMenuItemNewWithLabel, checkMenuItemNewWithMnemonic, + +-- * Methods checkMenuItemSetActive, checkMenuItemGetActive, checkMenuItemToggled, @@ -53,7 +82,8 @@ {#context lib="gtk" prefix="gtk" #} --- methods +-------------------- +-- Constructors -- | Create a new 'MenuItem' with a check next to it. -- @@ -77,6 +107,9 @@ makeNewObject mkCheckMenuItem $ liftM castPtr $ {#call unsafe check_menu_item_new_with_mnemonic#} strPtr +-------------------- +-- Methods + -- | Sets the active state of the menu item's check box. -- checkMenuItemSetActive :: CheckMenuItemClass mi => mi -> Bool -> IO () Index: Toolbar.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/MenuComboToolbar/Toolbar.chs.pp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Toolbar.chs.pp 12 Feb 2005 17:19:23 -0000 1.2 +++ Toolbar.chs.pp 25 Feb 2005 01:11:35 -0000 1.3 @@ -50,6 +50,16 @@ -- Creating a context menu for the toolbar can be done using -- 'onPopupContextMenu'. +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Container' +-- | +----Toolbar +-- @ + #ifndef DISABLE_DEPRECATED -- | * The following information applies to the old interface only. -- @@ -70,12 +80,17 @@ -- honored this way. #endif +-- * Types Toolbar, ToolbarClass, castToToolbar, Orientation(..), ToolbarStyle(..), + +-- * Constructors toolbarNew, + +-- * Methods #ifndef DISABLE_DEPRECATED toolbarInsertNewButton, toolbarAppendNewButton, @@ -148,7 +163,8 @@ {# context lib="gtk" prefix="gtk" #} --- methods +-------------------- +-- Constructors -- | Create a new, empty toolbar. -- @@ -163,6 +179,9 @@ mkToolText (Just (text,private)) fun = withUTFString text $ \txtPtr -> withUTFString private $ \prvPtr -> fun txtPtr prvPtr +-------------------- +-- Methods + #ifndef DISABLE_DEPRECATED -- | Insert a new 'Button' into the 'Toolbar'. -- @@ -486,7 +505,8 @@ {#call unsafe toolbar_get_relief_style#} (toToolbar tb) #endif --- signals +-------------------- +-- Signals -- | Emitted when toolbarSetOrientation is called. -- Index: OptionMenu.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/MenuComboToolbar/OptionMenu.chs.pp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- OptionMenu.chs.pp 12 Feb 2005 17:19:23 -0000 1.2 +++ OptionMenu.chs.pp 25 Feb 2005 01:11:35 -0000 1.3 @@ -20,21 +20,56 @@ -- Lesser General Public License for more details. -- -- | --- Maintainer : gtk2hs-users\@lists.sourceforge.net +-- Maintainer : gtk...@li... -- Stability : provisional -- Portability : portable (depends on GHC) -- +-- A widget used to choose from a list of valid choices. +-- module Graphics.UI.Gtk.MenuComboToolbar.OptionMenu ( +-- * Description +-- +-- | A 'OptionMenu' is a widget that allows the user to choose from a list of +-- valid choices. The 'OptionMenu' displays the selected choice. When activated +-- the 'OptionMenu' displays a popup 'Menu' which allows the user to make a new +-- choice. +-- +-- Using a 'OptionMenu' is simple; build a 'Menu', by calling 'menuNew', +-- then appending menu items to it with 'menuShellAppend'. Set that menu on the +-- option menu with 'optionMenuSetMenu'. Set the selected menu item with +-- 'optionMenuSetHistory'; connect to the \"changed\" signal on the option +-- menu; in the \"changed\" signal, check the new selected menu item with +-- 'optionMenuGetHistory'. +-- +-- As of Gtk+ 2.4, 'OptionMenu' has been deprecated in favor of 'ComboBox'. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Container' +-- | +----'Bin' +-- | +----'Button' +-- | +----OptionMenu +-- @ + #ifndef DISABLE_DEPRECATED +-- * Types OptionMenu, OptionMenuClass, castToOptionMenu, + +-- * Methods optionMenuNew, optionMenuGetMenu, optionMenuSetMenu, optionMenuRemoveMenu, optionMenuSetHistory, optionMenuGetHistory, + +-- * Signals onOMChanged, afterOMChanged #endif @@ -50,7 +85,8 @@ {# context lib="gtk" prefix="gtk" #} --- methods +-------------------- +-- Methods -- | Create a new option menu. -- @@ -91,7 +127,8 @@ optionMenuGetHistory om = liftM fromIntegral $ {#call unsafe option_menu_get_history#} (toOptionMenu om) --- signals +-------------------- +-- Signals -- | This signal is called if the selected option has changed. -- Index: ComboBoxEntry.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/MenuComboToolbar/ComboBoxEntry.chs.pp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ComboBoxEntry.chs.pp 12 Feb 2005 17:19:23 -0000 1.2 +++ ComboBoxEntry.chs.pp 25 Feb 2005 01:11:34 -0000 1.3 @@ -29,12 +29,34 @@ -- * Added in gtk 2.4 -- module Graphics.UI.Gtk.MenuComboToolbar.ComboBoxEntry ( +-- * Description +-- +-- | * Module available since Gtk version 2.4 + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Container' +-- | +----'Bin' +-- | +----'ComboBox' +-- | +----ComboBoxEntry +-- @ + #if GTK_CHECK_VERSION(2,4,0) - ComboBoxEntryClass, +-- * Types ComboBoxEntry, + ComboBoxEntryClass, + castToComboBoxEntry, + +-- * Constructors comboBoxEntryNew, comboBoxEntryNewWithModel, comboBoxEntryNewText, + +-- * Methods comboBoxEntrySetTextColumn, comboBoxEntryGetTextColumn, #endif @@ -51,6 +73,8 @@ {# context lib="gtk" prefix ="gtk" #} +-------------------- +-- Constructors comboBoxEntryNew :: IO ComboBoxEntry comboBoxEntryNew = @@ -67,6 +91,9 @@ makeNewObject mkComboBoxEntry $ liftM castPtr $ {# call gtk_combo_box_entry_new_text #} +-------------------- +-- Methods + comboBoxEntrySetTextColumn :: ComboBoxEntryClass combo => combo -> Int -> IO () comboBoxEntrySetTextColumn combo textColumn = {# call gtk_combo_box_entry_set_text_column #} (toComboBoxEntry combo) Index: TearoffMenuItem.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/MenuComboToolbar/TearoffMenuItem.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- TearoffMenuItem.chs 12 Feb 2005 17:19:23 -0000 1.2 +++ TearoffMenuItem.chs 25 Feb 2005 01:11:35 -0000 1.3 @@ -24,19 +24,42 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- * A TearoffMenuItem is a special GtkMenuItem which is used to tear off --- and reattach its menu. When its menu is shown normally, the --- TearoffMenuItem is drawn as a dotted line indicating that the menu can --- be torn off. Activating it causes its menu to be torn off and displayed --- in its own window as a tearoff menu. When its menu is shown as a tearoff --- menu, the TearoffMenuItem is drawn as a dotted line which has a left --- pointing arrow graphic indicating that the tearoff menu can be reattached. --- Activating it will erase the tearoff menu window. +-- A menu item used to tear off and reattach its menu. -- module Graphics.UI.Gtk.MenuComboToolbar.TearoffMenuItem ( +-- * Description +-- +-- | a 'TearoffMenuItem' is a special 'MenuItem' which is used to tear off and +-- reattach its menu. +-- +-- When its menu is shown normally, the 'TearoffMenuItem' is drawn as a +-- dotted line indicating that the menu can be torn off. Activating it causes +-- its menu to be torn off and displayed in its own window as a tearoff menu. +-- +-- When its menu is shown as a tearoff menu, the 'TearoffMenuItem' is drawn +-- as a dotted line which has a left pointing arrow graphic indicating that the +-- tearoff menu can be reattached. Activating it will erase the tearoff menu +-- window. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Container' +-- | +----'Bin' +-- | +----'Item' +-- | +----'MenuItem' +-- | +----TearoffMenuItem +-- @ + +-- * Types TearoffMenuItem, TearoffMenuItemClass, castToTearoffMenuItem, + +-- * Constructors tearoffMenuItemNew ) where @@ -49,11 +72,11 @@ {# context lib="gtk" prefix="gtk" #} --- methods +-------------------- +-- Constructors -- | Create a new tear off menu item. -- tearoffMenuItemNew :: IO TearoffMenuItem tearoffMenuItemNew = makeNewObject mkTearoffMenuItem $ liftM castPtr {#call unsafe tearoff_menu_item_new#} - Index: MenuItem.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/MenuComboToolbar/MenuItem.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- MenuItem.chs 12 Feb 2005 17:19:23 -0000 1.2 +++ MenuItem.chs 25 Feb 2005 01:11:35 -0000 1.3 @@ -19,6 +19,13 @@ -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- Lesser General Public License for more details. -- +-- TODO +-- +-- figure out what the signals \"toggle-size-allocate\" and +-- \"toggle-size-request\" are good for and bind them if useful +-- +-- figure out if the connectToToggle signal is useful at all +-- -- | -- Maintainer : gtk...@li... -- Stability : provisional @@ -30,20 +37,43 @@ -- is the only child of that widget. The three signals defined by Item are -- therefore bound in this module. -- --- TODO --- --- * figure out what the signals \"toggle-size-allocate\" and --- \"toggle-size-request\" are good for and bind them if useful --- --- * figure out if the connectToToggle signal is useful at all --- module Graphics.UI.Gtk.MenuComboToolbar.MenuItem ( +-- * Description +-- +-- | The 'MenuItem' widget and the derived widgets are the only valid childs +-- for menus. Their function is to correctly handle highlighting, alignment, +-- events and submenus. +-- +-- As it derives from 'Bin' it can hold any valid child widget, altough only +-- a few are really useful. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Container' +-- | +----'Bin' +-- | +----'Item' +-- | +----MenuItem +-- | +----'CheckMenuItem' +-- | +----'ImageMenuItem' +-- | +----'SeparatorMenuItem' +-- | +----'TearoffMenuItem' +-- @ + +-- * Types MenuItem, MenuItemClass, castToMenuItem, + +-- * Constructors menuItemNew, menuItemNewWithLabel, menuItemNewWithMnemonic, + +-- * Methods menuItemSetSubmenu, menuItemGetSubmenu, menuItemRemoveSubmenu, @@ -57,6 +87,8 @@ afterActivateLeaf, onActivateItem, afterActivateItem, + +-- * Signals onSelect, afterSelect, onDeselect, @@ -75,7 +107,8 @@ {# context lib="gtk" prefix="gtk" #} --- methods +-------------------- +-- Constructors -- | Create a new menu item. This is the smallest part -- of a menu that the user can click on or select with the keyboard. @@ -99,6 +132,9 @@ makeNewObject mkMenuItem $ liftM castPtr $ {#call unsafe menu_item_new_with_mnemonic#} strPtr +-------------------- +-- Methods + -- | Set the item's submenu. -- menuItemSetSubmenu :: (MenuItemClass mi, MenuClass m) => mi -> m -> IO () @@ -165,7 +201,8 @@ maybeWith withCString accelPath $ \strPtr -> {#call menu_item_set_accel_path#} (toMenuItem mi) strPtr --- signals +-------------------- +-- Signals -- | The user has chosen the menu item and the item does not contain a submenu. -- Index: ComboBox.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/MenuComboToolbar/ComboBox.chs.pp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ComboBox.chs.pp 12 Feb 2005 17:19:23 -0000 1.2 +++ ComboBox.chs.pp 25 Feb 2005 01:11:34 -0000 1.3 @@ -29,11 +29,34 @@ -- * Added in Gtk 2.4 -- module Graphics.UI.Gtk.MenuComboToolbar.ComboBox ( +-- * Description +-- +-- | * Module available since Gtk version 2.4 + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Container' +-- | +----'Bin' +-- | +----ComboBox +-- | +----'ComboBoxEntry' +-- @ + #if GTK_CHECK_VERSION(2,4,0) - ComboBoxClass, +-- * Types ComboBox, + ComboBoxClass, + castToComboBox, + +-- * Constructors comboBoxNew, + comboBoxNewText, comboBoxNewWithModel, + +-- * Methods comboBoxSetWrapWidth, comboBoxSetRowSpanColumn, comboBoxSetColumnSpanColumn, @@ -43,7 +66,6 @@ comboBoxSetActiveIter, comboBoxGetModel, comboBoxSetModel, - comboBoxNewText, comboBoxAppendText, comboBoxInsertText, comboBoxPrependText, @@ -67,17 +89,27 @@ {# context lib="gtk" prefix ="gtk" #} +-------------------- +-- Constructors comboBoxNew :: IO ComboBox comboBoxNew = makeNewObject mkComboBox $ liftM castPtr $ {# call gtk_combo_box_new #} +comboBoxNewText :: IO ComboBox +comboBoxNewText = + makeNewObject mkComboBox $ liftM castPtr $ + {# call gtk_combo_box_new_text #} + comboBoxNewWithModel :: TreeModel -> IO ComboBox comboBoxNewWithModel model = makeNewObject mkComboBox $ liftM castPtr $ {# call gtk_combo_box_new_with_model #} model +-------------------- +-- Methods + comboBoxSetWrapWidth :: ComboBoxClass combo => combo -> Int -> IO () comboBoxSetWrapWidth combo width = {# call gtk_combo_box_set_wrap_width #} (toComboBox combo) @@ -128,11 +160,6 @@ comboBoxSetModel combo model = {# call gtk_combo_box_set_model #} (toComboBox combo) model -comboBoxNewText :: IO ComboBox -comboBoxNewText = - makeNewObject mkComboBox $ liftM castPtr $ - {# call gtk_combo_box_new_text #} - comboBoxAppendText :: ComboBoxClass combo => combo -> String -> IO () comboBoxAppendText combo text = withUTFString text $ \strPtr -> Index: MenuShell.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/MenuComboToolbar/MenuShell.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- MenuShell.chs 12 Feb 2005 17:19:23 -0000 1.2 +++ MenuShell.chs 25 Feb 2005 01:11:35 -0000 1.3 @@ -28,15 +28,42 @@ -- menu items. -- module Graphics.UI.Gtk.MenuComboToolbar.MenuShell ( +-- * Description +-- +-- | A 'MenuShell' is the abstract base class used to derive the 'Menu' and +-- 'MenuBar' subclasses. +-- +-- A 'MenuShell' is a container of 'MenuItem' objects arranged in a list +-- which can be navigated, selected, and activated by the user to perform +-- application functions. A 'MenuItem' can have a submenu associated with it, +-- allowing for nested hierarchical menus. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Container' +-- | +----MenuShell +-- | +----'MenuBar' +-- | +----'Menu' +-- @ + +-- * Types MenuShell, MenuShellClass, castToMenuShell, + +-- * Methods menuShellAppend, menuShellPrepend, menuShellInsert, menuShellDeactivate, menuShellSelectItem, menuShellDeselect, + +-- * Signals onActivateCurrent, afterActivateCurrent, onCancel, @@ -60,7 +87,8 @@ {# context lib="gtk" prefix="gtk" #} --- methods +-------------------- +-- Methods -- | Append the new entry @child@ to a menu. -- @@ -110,7 +138,8 @@ menuShellDeselect ms = {#call menu_shell_deselect#} (toMenuShell ms) --- signals +-------------------- +-- Signals -- | This signal is called if an item is -- activated. The boolean flag @hide@ is True whenever the menu will Index: ImageMenuItem.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/MenuComboToolbar/ImageMenuItem.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ImageMenuItem.chs 12 Feb 2005 17:19:23 -0000 1.2 +++ ImageMenuItem.chs 25 Feb 2005 01:11:34 -0000 1.3 @@ -31,14 +31,41 @@ -- * imageMenuItemNewFromSock should also have a AccelGroup argument -- module Graphics.UI.Gtk.MenuComboToolbar.ImageMenuItem ( +-- * Description +-- +-- | A 'ImageMenuItem' is a menu item which has an icon next to the text +-- label. +-- +-- Note that the user can disable display of menu icons, so make sure to +-- still fill in the text label. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Container' +-- | +----'Bin' +-- | +----'Item' +-- | +----'MenuItem' +-- | +----ImageMenuItem +-- @ + +-- * Types ImageMenuItem, ImageMenuItemClass, - imageMenuItemSetImage, - imageMenuItemGetImage, + castToImageMenuItem, + +-- * Constructors imageMenuItemNew, imageMenuItemNewFromStock, imageMenuItemNewWithLabel, - imageMenuItemNewWithMnemonic + imageMenuItemNewWithMnemonic, + +-- * Methods + imageMenuItemSetImage, + imageMenuItemGetImage ) where import Monad (liftM) @@ -51,24 +78,8 @@ {#context lib="gtk" prefix="gtk" #} --- methods - - --- | Sets the image for the ImageMenuItem. --- -imageMenuItemSetImage :: (ImageMenuItemClass imi,WidgetClass wd) => - imi -> wd -> IO () -imageMenuItemSetImage imi wd = - {#call unsafe image_menu_item_set_image#} (toImageMenuItem imi) - (toWidget wd) - --- | Get the image that is currently set a the image. --- -imageMenuItemGetImage :: ImageMenuItemClass imi => imi -> IO (Maybe Widget) -imageMenuItemGetImage imi = do - imPtr <- {#call unsafe image_menu_item_get_image#} (toImageMenuItem imi) - if imPtr==nullPtr then return Nothing else do - liftM Just $ makeNewObject mkWidget $ return imPtr +-------------------- +-- Constructors -- | Create a new 'MenuItem' with a image next to it. -- @@ -98,3 +109,22 @@ imageMenuItemNewWithMnemonic str = withUTFString str $ \strPtr -> makeNewObject mkImageMenuItem $ liftM castPtr $ {#call unsafe image_menu_item_new_with_mnemonic#} strPtr + +-------------------- +-- Methods + +-- | Sets the image for the ImageMenuItem. +-- +imageMenuItemSetImage :: (ImageMenuItemClass imi,WidgetClass wd) => + imi -> wd -> IO () +imageMenuItemSetImage imi wd = + {#call unsafe image_menu_item_set_image#} (toImageMenuItem imi) + (toWidget wd) + +-- | Get the image that is currently set a the image. +-- +imageMenuItemGetImage :: ImageMenuItemClass imi => imi -> IO (Maybe Widget) +imageMenuItemGetImage imi = do + imPtr <- {#call unsafe image_menu_item_get_image#} (toImageMenuItem imi) + if imPtr==nullPtr then return Nothing else do + liftM Just $ makeNewObject mkWidget $ return imPtr |