From: Duncan C. <dun...@us...> - 2005-02-25 01:12:37
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Buttons In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24163/gtk/Graphics/UI/Gtk/Buttons Modified Files: Button.chs.pp CheckButton.chs RadioButton.chs ToggleButton.chs 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: RadioButton.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Buttons/RadioButton.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- RadioButton.chs 12 Feb 2005 17:19:21 -0000 1.2 +++ RadioButton.chs 25 Feb 2005 01:11:32 -0000 1.3 @@ -19,29 +19,55 @@ -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- Lesser General Public License for more details. -- +-- TODO +-- +-- No function that directly accesses the group is bound. This is due to the +-- difficulties assuring that these groups are valid as the group is a plain +-- GSList from Glib. +-- -- | -- Maintainer : gtk...@li... -- Stability : provisional -- Portability : portable (depends on GHC) -- --- A radio group is a set of check buttons where only one button can be --- checked. --- --- * Each radio button has to be associated with a group. Generating a new --- radio button makes up a new group. Other group members can be added by --- generating radio buttons with the function --- 'radioButtonNewJoinGroup'. +-- A choice from multiple check buttons. -- --- TODO +module Graphics.UI.Gtk.Buttons.RadioButton ( +-- * Description +-- +-- | A single radio button performs the same basic function as a +-- 'CheckButton', as its position in the object hierarchy reflects. It is only +-- when multiple radio buttons are grouped together that they become a +-- different user interface component in their own right. -- --- * No function that directly accesses the group is bound. This is due to the --- difficulties assuring that these groups are valid as the group is a plain --- GSList from Glib. +-- Every radio button is a member of some group of radio buttons. When one +-- is selected, all other radio buttons in the same group are deselected. A +-- 'RadioButton' is one way of giving the user a choice from many options. -- -module Graphics.UI.Gtk.Buttons.RadioButton ( +-- Each radio button has to be associated with a group. Generating a new +-- radio button makes up a new group. Other group members can be added by +-- generating radio buttons with the function 'radioButtonNewJoinGroup'. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Container' +-- | +----'Bin' +-- | +----'Button' +-- | +----'ToggleButton' +-- | +----'CheckButton' +-- | +----RadioButton +-- @ + +-- * Types RadioButton, RadioButtonClass, castToRadioButton, + +-- * Constructors radioButtonNew, radioButtonNewWithLabel, radioButtonNewWithMnemonic, @@ -65,7 +91,8 @@ {# context lib="gtk" prefix="gtk" #} --- methods +-------------------- +-- Constructors -- | Create a new RadioButton widget with a new group. -- Index: CheckButton.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Buttons/CheckButton.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- CheckButton.chs 12 Feb 2005 17:19:21 -0000 1.2 +++ CheckButton.chs 25 Feb 2005 01:11:32 -0000 1.3 @@ -27,9 +27,34 @@ -- create widgets with a discrete toggle button. -- module Graphics.UI.Gtk.Buttons.CheckButton ( +-- * Description +-- +-- | A 'CheckButton' places a discrete 'ToggleButton' next to a widget, +-- (usually a 'Label'). See the section on 'ToggleButton' widgets for more +-- information about toggle\/check buttons. +-- +-- The important signal (\'toggled\') is also inherited from 'ToggleButton'. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Container' +-- | +----'Bin' +-- | +----'Button' +-- | +----'ToggleButton' +-- | +----CheckButton +-- | +----'RadioButton' +-- @ + +-- * Types CheckButton, CheckButtonClass, castToCheckButton, + +-- * Constructors checkButtonNew, checkButtonNewWithLabel, checkButtonNewWithMnemonic @@ -45,7 +70,8 @@ {# context lib="gtk" prefix="gtk" #} --- methods +-------------------- +-- Constructors -- | Create a new button with a check field. -- @@ -71,5 +97,3 @@ checkButtonNewWithMnemonic lbl = withUTFString lbl (\strPtr -> makeNewObject mkCheckButton $ liftM castPtr $ {#call unsafe check_button_new_with_mnemonic#} strPtr) - - Index: ToggleButton.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Buttons/ToggleButton.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ToggleButton.chs 12 Feb 2005 17:19:21 -0000 1.2 +++ ToggleButton.chs 25 Feb 2005 01:11:32 -0000 1.3 @@ -24,16 +24,49 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- A ToggleButton is the base class for all buttons that have an inherit --- state. +-- Create buttons which retain their state. -- module Graphics.UI.Gtk.Buttons.ToggleButton ( +-- * Description +-- +-- | A 'ToggleButton' is a 'Button' which will remain \'pressed-in\' when +-- clicked. Clicking again will cause the toggle button to return to its normal +-- state. +-- +-- A toggle button is created by calling either 'toggleButtonNew' or +-- 'toggleButtonNewWithLabel'. If using the former, it is advisable to pack a +-- widget, (such as a 'Label' and\/or a 'Pixmap'), into the toggle button's +-- container. (See 'Button' for more information). +-- +-- The state of a 'ToggleButton' can be set specifically using +-- 'toggleButtonSetActive', and retrieved using 'toggleButtonGetActive'. +-- +-- To simply switch the state of a toggle button, use 'toggleButtonToggled'. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Container' +-- | +----'Bin' +-- | +----'Button' +-- | +----ToggleButton +-- | +----'CheckButton' +-- @ + +-- * Types ToggleButton, ToggleButtonClass, castToToggleButton, + +-- * Constructors toggleButtonNew, toggleButtonNewWithLabel, toggleButtonNewWithMnemonic, + +-- * Methods toggleButtonSetMode, toggleButtonGetMode, toggleButtonToggled, @@ -41,6 +74,8 @@ toggleButtonSetActive, toggleButtonGetInconsistent, toggleButtonSetInconsistent, + +-- * Signals onToggled, afterToggled ) where @@ -55,7 +90,8 @@ {# context lib="gtk" prefix="gtk" #} --- methods +-------------------- +-- Constructors -- | Create a new ToggleButton widget. -- @@ -79,6 +115,9 @@ makeNewObject mkToggleButton $ liftM castPtr $ {#call unsafe toggle_button_new_with_mnemonic#} strPtr) +-------------------- +-- Methods + -- | Sets whether the button is displayed as a separate indicator and label. -- You can call this function on a "CheckButton" or a "RadioButton" with @False@ -- to make the button look like a normal button. @@ -126,8 +165,8 @@ toggleButtonSetInconsistent incon tb = {#call toggle_button_set_inconsistent#} (toToggleButton tb) (fromBool incon) --- signals - +-------------------- +-- Signals -- | Whenever the state of the button is changed, the toggled signal is emitted. -- Index: Button.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Buttons/Button.chs.pp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Button.chs.pp 12 Feb 2005 17:19:21 -0000 1.2 +++ Button.chs.pp 25 Feb 2005 01:11:32 -0000 1.3 @@ -27,13 +27,43 @@ -- A widget that creates a signal when clicked on. -- module Graphics.UI.Gtk.Buttons.Button ( +-- * Description +-- +-- | The 'Button' widget is generally used to attach a function to that is +-- called when the button is pressed. The various signals and how to use them +-- are outlined below. +-- +-- The 'Button' widget can hold any valid child widget. That is it can hold +-- most any other standard 'Widget'. The most commonly used child is the +-- 'Label'. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Container' +-- | +----'Bin' +-- | +----Button +-- | +----'ToggleButton' +-- | +----'ColorButton' +-- | +----'FontButton' +-- | +----'OptionMenu' +-- @ + +-- * Types Button, ButtonClass, castToButton, + +-- * Constructors buttonNew, buttonNewWithLabel, buttonNewWithMnemonic, buttonNewFromStock, + +-- * Methods buttonPressed, buttonReleased, buttonClicked, @@ -54,6 +84,8 @@ buttonSetAlignment, buttonGetAlignment, #endif + +-- * Signals onButtonActivate, afterButtonActivate, onClicked, @@ -79,7 +111,8 @@ {# context lib="gtk" prefix="gtk" #} --- methods +-------------------- +-- Constructors -- | Create a new Button widget. -- @@ -113,6 +146,9 @@ throwIfNull "buttonNewFromStock: Invalid stock identifier." $ {#call unsafe button_new_from_stock#} strPtr) +-------------------- +-- Methods + -- | Depress the button, i.e. emit the pressed signal. -- buttonPressed :: ButtonClass b => b -> IO () @@ -234,8 +270,8 @@ return (realToFrac xalign, realToFrac yalign) #endif - --- signals +-------------------- +-- Signals -- | The button has been depressed (but not -- necessarily released yet). See @clicked@ signal. |