Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24163/gtk/Graphics/UI/Gtk/Misc Modified Files: Adjustment.chs Calendar.chs.pp DrawingArea.chs EventBox.chs.pp HandleBox.chs SizeGroup.chs Tooltips.chs.pp Viewport.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: DrawingArea.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Misc/DrawingArea.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- DrawingArea.chs 12 Feb 2005 17:19:23 -0000 1.2 +++ DrawingArea.chs 25 Feb 2005 01:11:35 -0000 1.3 @@ -24,24 +24,64 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- A user-defined widget. --- --- * The 'DrawingArea' widget is used for creating custom --- user interface elements. It's essentially a blank widget. Drawing on --- the 'Drawable' returned by 'drawingAreaGetWindow' --- has to be done each time the window manager sends @\"expose\"@ --- events. Note that the library automatically clears the exposed area to --- the background color before sending the expose event, and that drawing --- is implicitly clipped to the exposed area. Other events which are --- interesting for interacting are mouse and butten events defined in --- 'Widget'. If the widget changes in size (which it does --- initially), a @\"configure\"@ event is emitted. +-- A widget for custom user interface elements. -- module Graphics.UI.Gtk.Misc.DrawingArea ( +-- * Description +-- +-- | The 'DrawingArea' widget is used for creating custom user interface +-- elements. It's essentially a blank widget; you can draw on +-- the 'Drawable' returned by 'drawingAreaGetWindow'. +-- +-- After creating a drawing area, the application may want to connect to: +-- +-- * Mouse and button press signals to respond to input from the user. (Use +-- 'widgetAddEvents' to enable events you wish to receive.) +-- +-- * The \"realize\" signal to take any necessary actions when the widget is +-- instantiated on a particular display. (Create GDK resources in response to +-- this signal.) +-- +-- * The \"configure_event\" signal to take any necessary actions when the +-- widget changes size. +-- +-- * The \"expose_event\" signal to handle redrawing the contents of the +-- widget. +-- +-- Expose events are normally delivered when a drawing area first comes +-- onscreen, or when it's covered by another window and then uncovered +-- (exposed). You can also force an expose event by adding to the \"damage +-- region\" of the drawing area's window; 'widgetQueueDrawArea' and +-- 'windowInvalidateRect' are equally good ways to do this. You\'ll then get an +-- expose event for the invalid region. +-- +-- The available routines for drawing are documented on the GDK Drawing +-- Primitives page. See also 'pixbufRenderToDrawable' for drawing a 'Pixbuf'. +-- +-- To receive mouse events on a drawing area, you will need to enable them +-- with 'widgetAddEvents'. To receive keyboard events, you will need to set the +-- 'CanFocus' flag on the drawing area, and should probably draw some +-- user-visible indication that the drawing area is focused. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----DrawingArea +-- | +----'Curve' +-- @ + +-- * Types DrawingArea, DrawingAreaClass, castToDrawingArea, + +-- * Constructors drawingAreaNew, + +-- * Methods drawingAreaGetDrawWindow, drawingAreaGetSize) where @@ -55,11 +95,11 @@ {# context lib="gtk" prefix="gtk" #} --- methods +-------------------- +-- Constructors -- | Create a new custom widget. -- drawingAreaNew :: IO DrawingArea drawingAreaNew = makeNewObject mkDrawingArea $ liftM castPtr {#call unsafe drawing_area_new#} - Index: HandleBox.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Misc/HandleBox.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- HandleBox.chs 12 Feb 2005 17:19:24 -0000 1.2 +++ HandleBox.chs 25 Feb 2005 01:11:35 -0000 1.3 @@ -24,33 +24,51 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- Add a handle to some other widget so that it can be detached and --- reattached from the main application. --- --- * The GtkHandleBox widget allows a portion of a window to be \"torn off\". It --- is a bin widget which displays its child and a handle that the user can --- drag to tear off a separate window (the float window) containing the --- child widget. A thin ghost is drawn in the original location of the --- handlebox. By dragging the separate window back to its original location, --- it can be reattached. --- When reattaching, the ghost and float window, must be aligned along one --- of the edges, the snap edge. This either can be specified by the --- application programmer explicitely, or GTK+ will pick a reasonable --- default based on the handle position. --- To make detaching and reattaching the handlebox as minimally confusing --- as possible to the user, it is important to set the snap edge so that --- the snap edge does not move when the handlebox is deattached. For --- instance, if the handlebox is packed at the bottom of a 'VBox', --- then when --- the handlebox is detached, the bottom edge of the handlebox's allocation --- will remain fixed as the height of the handlebox shrinks, so the snap --- edge should be set to 'PosBottom'. +-- A widget for detachable window portions. -- module Graphics.UI.Gtk.Misc.HandleBox ( +-- * Description +-- +-- | The 'HandleBox' widget allows a portion of a window to be \"torn off\". +-- It is a bin widget which displays its child and a handle that the user can +-- drag to tear off a separate window (the float window) containing the child +-- widget. A thin ghost is drawn in the original location of the handlebox. By +-- dragging the separate window back to its original location, it can be +-- reattached. +-- +-- When reattaching, the ghost and float window, must be aligned along one +-- of the edges, the snap edge. This either can be specified by the application +-- programmer explicitely, or Gtk+ will pick a reasonable default based on the +-- handle position. +-- +-- To make detaching and reattaching the handlebox as minimally confusing as +-- possible to the user, it is important to set the snap edge so that the snap +-- edge does not move when the handlebox is deattached. For instance, if the +-- handlebox is packed at the bottom of a VBox, then when the handlebox is +-- detached, the bottom edge of the handlebox's allocation will remain fixed as +-- the height of the handlebox shrinks, so the snap edge should be set to +-- 'PosBottom'. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Container' +-- | +----'Bin' +-- | +----HandleBox +-- @ + +-- * Types HandleBox, HandleBoxClass, castToHandleBox, + +-- * Constructors handleBoxNew, + +-- * Methods ShadowType(..), handleBoxSetShadowType, handleBoxGetShadowType, @@ -59,6 +77,8 @@ handleBoxGetHandlePosition, handleBoxSetSnapEdge, handleBoxGetSnapEdge, + +-- * Signals onChildAttached, afterChildAttached, onChildDetached, @@ -75,7 +95,8 @@ {# context lib="gtk" prefix="gtk" #} --- methods +-------------------- +-- Constructors -- | Create a new handle box. -- @@ -83,6 +104,9 @@ handleBoxNew = makeNewObject mkHandleBox $ liftM castPtr {#call unsafe handle_box_new#} +-------------------- +-- Methods + -- | Set the shadow type of the detached box. -- handleBoxSetShadowType :: HandleBoxClass hb => hb -> ShadowType -> IO () @@ -129,7 +153,8 @@ handleBoxGetSnapEdge hb = liftM (toEnum.fromIntegral) $ {#call unsafe handle_box_get_snap_edge#} (toHandleBox hb) --- signals +-------------------- +-- Signals -- | Emitted when the contents of the handlebox -- are reattached to the main window. Index: Adjustment.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Misc/Adjustment.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Adjustment.chs 12 Feb 2005 17:19:23 -0000 1.2 +++ Adjustment.chs 25 Feb 2005 01:11:35 -0000 1.3 @@ -24,17 +24,42 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- An adjustment is a bounded value controlled by the user. --- --- An Adjustment object contains a value with maximum bounds and a step size. --- It is used to represent the value of a scoll bar and similar widgets. In --- particular it is contained in the abstract 'Range' widget. +-- A 'Object' representing an adjustable bounded value -- module Graphics.UI.Gtk.Misc.Adjustment ( +-- * Description +-- +-- | The 'Adjustment' object represents a value which has an associated lower +-- and upper bound, together with step and page increments, and a page size. It +-- is used within several Gtk+ widgets, including 'SpinButton', 'Viewport', and +-- 'Range' (which is a base class for 'HScrollbar', 'VScrollbar', 'HScale', and +-- 'VScale'). +-- +-- The 'Adjustment' object does not update the value itself. Instead it is +-- left up to the owner of the 'Adjustment' to control the value. +-- +-- The owner of the 'Adjustment' typically calls the +-- 'adjustmentValueChanged' and 'adjustmentChanged' functions after changing +-- the value and its bounds. This results in the emission of the +-- \"value_changed\" or \"changed\" signal respectively. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----Adjustment +-- @ + +-- * Types Adjustment, AdjustmentClass, castToAdjustment, + +-- * Constructors adjustmentNew, + +-- * Methods adjustmentSetLower, adjustmentGetLower, adjustmentSetPageIncrement, @@ -48,6 +73,8 @@ adjustmentSetValue, adjustmentGetValue, adjustmentClampPage, + +-- * Signals onAdjChanged, afterAdjChanged, onValueChanged, @@ -64,7 +91,8 @@ {# context lib="gtk" prefix="gtk" #} --- methods +-------------------- +-- Constructors -- | Create a new Adjustment object. -- @@ -83,6 +111,9 @@ (realToFrac stepIncrement) (realToFrac pageIncrement) (realToFrac pageSize) +-------------------- +-- Methods + -- | Set the lower value. adjustmentSetLower :: Adjustment -> Double -> IO () adjustmentSetLower a val = objectSetProperty a "lower" (GVdouble val) @@ -159,7 +190,8 @@ adjustmentClampPage a lower upper = {#call adjustment_clamp_page#} a (realToFrac lower) (realToFrac upper) --- signals +-------------------- +-- Signals -- | This signal is emitted if some value of -- Adjustment except @value@ itself changes. Index: EventBox.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Misc/EventBox.chs.pp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- EventBox.chs.pp 12 Feb 2005 17:19:24 -0000 1.2 +++ EventBox.chs.pp 25 Feb 2005 01:11:35 -0000 1.3 @@ -24,13 +24,36 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- A widget used to catch events for widgets which do not have their own window. +-- A widget used to catch events for widgets which do not have their own +-- window. -- module Graphics.UI.Gtk.Misc.EventBox ( +-- * Description +-- +-- | The 'EventBox' widget is a subclass of 'Bin' which also has its own +-- window. It is useful since it allows you to catch events for widgets which +-- do not have their own window. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Container' +-- | +----'Bin' +-- | +----EventBox +-- @ + +-- * Types EventBox, EventBoxClass, castToEventBox, + +-- * Constructors eventBoxNew + +-- * Methods #if GTK_CHECK_VERSION(2,4,0) ,eventBoxSetVisibleWindow, eventBoxGetVisibleWindow, @@ -48,7 +71,8 @@ {# context lib="gtk" prefix="gtk" #} --- methods +-------------------- +-- Constructors -- | Create a new 'EventBox'. -- @@ -56,6 +80,9 @@ eventBoxNew = makeNewObject mkEventBox $ liftM castPtr {#call unsafe event_box_new#} +-------------------- +-- Methods + #if GTK_CHECK_VERSION(2,4,0) -- | Set whether the event box uses a visible or invisible child window. The -- default is to use visible windows. The C documentation for details of what Index: Tooltips.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Misc/Tooltips.chs.pp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Tooltips.chs.pp 12 Feb 2005 17:19:24 -0000 1.2 +++ Tooltips.chs.pp 25 Feb 2005 01:11:35 -0000 1.3 @@ -24,32 +24,54 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- Tooltips are the messages that appear next to a widget when the mouse +-- Add tips to your widgets. +-- +module Graphics.UI.Gtk.Misc.Tooltips ( +-- * Description +-- +-- | Tooltips are the messages that appear next to a widget when the mouse -- pointer is held over it for a short amount of time. They are especially --- helpful for adding more verbose descriptions of things such as buttons --- in a toolbar. +-- helpful for adding more verbose descriptions of things such as buttons in a +-- toolbar. -- -- An individual tooltip belongs to a group of tooltips. A group is created --- with a call to 'tooltipsNew'. Every tooltip in the group can --- then be turned off with a call to 'tooltipsDisable' and enabled with --- 'tooltipsEnable'. +-- with a call to 'tooltipsNew'. Every tooltip in the group can then be turned +-- off with a call to 'tooltipsDisable' and enabled with 'tooltipsEnable'. -- #ifndef DISABLE_DEPRECATED --- The length of time the user must keep the mouse over a widget before the tip --- is shown, can be altered with 'tooltipsSetDelay'. This is set on a 'per group --- of tooltips' basis. +-- The length of time the user must keep the mouse over a widget before the +-- tip is shown, can be altered with 'tooltipsSetDelay'. This is set on a \'per +-- group of tooltips\' basis. -- #endif --- To assign a tip to a particular widget, 'tooltipsSetTip' is used. +-- To assign a tip to a particular 'Widget', 'tooltipsSetTip' is used. -- -- To associate 'Tooltips' to a widget it is has to have its own 'DrawWindow'. -- Otherwise the widget must be set into an 'EventBox'. -- -module Graphics.UI.Gtk.Misc.Tooltips ( +-- The default appearance of all tooltips in a program is determined by the +-- current Gtk+ theme that the user has selected. +-- +-- Information about the tooltip (if any) associated with an arbitrary +-- widget can be retrieved using 'tooltipsDataGet'. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----Tooltips +-- @ + +-- * Types Tooltips, TooltipsClass, castToTooltips, + +-- * Constructors tooltipsNew, + +-- * Methods tooltipsEnable, tooltipsDisable, #ifndef DISABLE_DEPRECATED @@ -69,7 +91,8 @@ {# context lib="gtk" prefix="gtk" #} --- methods +-------------------- +-- Constructors -- | Create a new goup of 'Tooltips'. -- @@ -77,6 +100,9 @@ tooltipsNew = makeNewObject mkTooltips $ liftM castPtr {#call unsafe tooltips_new#} +-------------------- +-- Methods + -- | Display the help the 'Tooltips' group -- provides. -- Index: Viewport.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Misc/Viewport.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Viewport.chs 12 Feb 2005 17:19:24 -0000 1.2 +++ Viewport.chs 25 Feb 2005 01:11:35 -0000 1.3 @@ -19,6 +19,14 @@ -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- Lesser General Public License for more details. -- +-- Issues: +-- +-- The binding of this widget is superfluous as far as I can tell. +-- +-- The only signal this widget registers is \"set-scroll-adjustments\". It is +-- not bound because it is meant to be received by the 'Viewport' +-- and sent by 'ScrolledWindow'. +-- -- | -- Maintainer : gtk...@li... -- Stability : provisional @@ -28,17 +36,28 @@ -- widget, i.e. the widget becomes scrollable. It can then be put into -- 'ScrolledWindow' and will behave as expected. -- --- * The binding of this widget is superfluous as far as I can tell. --- --- * The only signal this widget registers is \"set-scroll-adjustments\". It is --- not bound because it is meant to be received by the 'Viewport' --- and sent by 'ScrolledWindow'. --- module Graphics.UI.Gtk.Misc.Viewport ( + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Container' +-- | +----'Bin' +-- | +----Viewport +-- @ + +-- * Types Viewport, ViewportClass, castToViewport, + +-- * Constructors viewportNew, + +-- * Methods viewportGetHAdjustment, viewportGetVAdjustment, viewportSetHAdjustment, @@ -58,7 +77,8 @@ {# context lib="gtk" prefix="gtk" #} --- methods +-------------------- +-- Constructors -- | Create a new 'Viewport'. -- @@ -66,6 +86,9 @@ viewportNew vAdj hAdj = makeNewObject mkViewport $ liftM castPtr $ {#call unsafe viewport_new#} hAdj vAdj +-------------------- +-- Methods + -- | Retrieve the horizontal -- 'Adjustment' of the 'Viewport'. -- @@ -105,6 +128,6 @@ viewportGetShadowType v = liftM (toEnum.fromIntegral) $ {#call unsafe viewport_get_shadow_type#} (toViewport v) --- signals - +-------------------- +-- Signals Index: Calendar.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Misc/Calendar.chs.pp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Calendar.chs.pp 12 Feb 2005 17:19:23 -0000 1.2 +++ Calendar.chs.pp 25 Feb 2005 01:11:35 -0000 1.3 @@ -27,10 +27,47 @@ -- Display a calendar and\/or allow the user to select a date. -- module Graphics.UI.Gtk.Misc.Calendar ( +-- * Description +-- +-- | 'Calendar' is a widget that displays a calendar, one month at a time. It +-- can be created with 'calendarNew'. +-- +-- The month and year currently displayed can be altered with +-- 'calendarSelectMonth'. The exact day can be selected from the displayed +-- month using 'calendarSelectDay'. +-- +-- To place a visual marker on a particular day, use 'calendarMarkDay' and +-- to remove the marker, 'calendarUnmarkDay'. Alternative, all marks can be +-- cleared with 'calendarClearMarks'. +-- +-- The way in which the calendar itself is displayed can be altered using +-- 'calendarSetDisplayOptions'. +-- +-- The selected date can be retrieved from a 'Calendar' using +-- 'calendarGetDate'. +-- +-- If performing many \'mark\' operations, the calendar can be frozen to +-- prevent flicker, using 'calendarFreeze', and \'thawed\' again using +-- 'calendarThaw'. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----Calendar +-- @ + +-- * Types Calendar, CalendarClass, castToCalendar, + +-- * Constructors calendarNew, + +-- * Methods calendarSelectMonth, calendarSelectDay, calendarMarkDay, @@ -42,6 +79,8 @@ calendarGetDisplayOptions, #endif calendarGetDate, + +-- * Signals onDaySelected, afterDaySelected, onDaySelectedDoubleClick, @@ -68,7 +107,8 @@ {# context lib="gtk" prefix="gtk" #} --- methods +-------------------- +-- Constructors -- | Create a new calendar widget. -- @@ -78,6 +118,9 @@ calendarNew = makeNewObject mkCalendar $ liftM castPtr {#call unsafe calendar_new#} +-------------------- +-- Methods + -- | Flip the page to a month , 0 is January,.., 11 -- is December. -- @@ -171,7 +214,8 @@ {#call calendar_thaw#} (toCalendar cal) return res --- signals +-------------------- +-- Signals -- | Emitted when a day was selected. -- Index: SizeGroup.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Misc/SizeGroup.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- SizeGroup.chs 12 Feb 2005 17:19:24 -0000 1.2 +++ SizeGroup.chs 25 Feb 2005 01:11:35 -0000 1.3 @@ -24,13 +24,52 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- SizeGroup provides a mechanism for grouping a number of widgets together so --- they all request the same amount of space. This is typically useful when you --- want a column of widgets to have the same size, but you can't use a "Table" --- widget. +-- Grouping widgets so they request the same size -- module Graphics.UI.Gtk.Misc.SizeGroup ( +-- * Description +-- +-- | 'SizeGroup' provides a mechanism for grouping a number of widgets +-- together so they all request the same amount of space. This is typically +-- useful when you want a column of widgets to have the same size, but you +-- can't use a 'Table' widget. +-- +-- In detail, the size requested for each widget in a 'SizeGroup' is the +-- maximum of the sizes that would have been requested for each widget in the +-- size group if they were not in the size group. The mode of the size group +-- (see 'sizeGroupSetMode') determines whether this applies to the horizontal +-- size, the vertical size, or both sizes. +-- +-- Note that size groups only affect the amount of space requested, not the +-- size that the widgets finally receive. If you want the widgets in a +-- 'SizeGroup' to actually be the same size, you need to pack them in such a +-- way that they get the size they request and not more. For example, if you +-- are packing your widgets into a table, you would not include the 'Fill' +-- flag. +-- +-- Widgets can be part of multiple size groups; Gtk+ will compute the +-- horizontal size of a widget from the horizontal requisition of all widgets +-- that can be reached from the widget by a chain of size groups of type +-- 'SizeGroupHorizontal' or 'SizeGroupBoth', and the vertical size from the +-- vertical requisition of all widgets that can be reached from the widget by a +-- chain of size groups of type 'SizeGroupVertical' or 'SizeGroupBoth'. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----SizeGroup +-- @ + +-- * Types + SizeGroup, + SizeGroupClass, + castToSizeGroup, + +-- * Constructors sizeGroupNew, + +-- * Methods SizeGroupMode(..), sizeGroupSetMode, sizeGroupGetMode, @@ -49,12 +88,18 @@ {#enum SizeGroupMode {underscoreToCase}#} +-------------------- +-- Constructors + -- | Create a new SizeGroup. -- sizeGroupNew :: SizeGroupMode -> IO SizeGroup sizeGroupNew mode = makeNewGObject mkSizeGroup $ {#call unsafe size_group_new#} ((fromIntegral.fromEnum) mode) +-------------------- +-- Methods + -- | Adds a widget to a SizeGroup. In the future, the requisition of the widget -- will be determined as the maximum of its requisition and the requisition of -- the other widgets in the size group. Whether this applies horizontally, |