From: Duncan C. <dun...@us...> - 2005-04-07 00:14:12
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Abstract In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2146/gtk/Graphics/UI/Gtk/Abstract Modified Files: Paned.chs.pp Range.chs Scrollbar.hs Widget.chs.pp Log Message: Add bindings for a bunch of extra methods and properties. Also, various doc changes. Index: Range.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Abstract/Range.chs,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Range.chs 2 Apr 2005 19:02:23 -0000 1.8 +++ Range.chs 7 Apr 2005 00:13:59 -0000 1.9 @@ -24,7 +24,7 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- Base class for widgets which visualize an 'Adjustment' +-- Base class for widgets which visualize an adjustment -- module Graphics.UI.Gtk.Abstract.Range ( -- * Description @@ -61,10 +61,6 @@ rangeSetIncrements, rangeSetRange, ScrollType(..), - rangeSetIncrements, - rangeSetRange, - rangeSetValue, - rangeGetValue, -- * Properties rangeUpdatePolicy, @@ -77,6 +73,8 @@ afterMoveSlider, onAdjustBounds, afterAdjustBounds, +-- onValueChanged, +-- afterValueChanged, ) where import Monad (liftM) Index: Widget.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Abstract/Widget.chs.pp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Widget.chs.pp 6 Apr 2005 22:20:02 -0000 1.1 +++ Widget.chs.pp 7 Apr 2005 00:13:59 -0000 1.2 @@ -23,19 +23,12 @@ -- -- unimplemented methods that seem to be useful in user programs: -- widgetSizeRequest, widgetAddAccelerator, widgetRemoveAccelerator, --- widgetAcceleratorSignal, widgetIntersect, widgetGrabDefault, --- widgetGetPointer, widgetPath, widgetClassPath, getCompositeName, --- widgetSetCompositeName, --- widgetModifyStyle, widgetGetModifierStyle, widgetModifyFg, --- widgetModifyBG, widgetModifyText, widgetModifyBase, widgetModifyFont, +-- widgetAcceleratorSignal, widgetGrabDefault, -- widgetPango*, widgetSetAdjustments -- -- implement the following methods in GtkWindow object: -- widget_set_uposition, widget_set_usize -- --- implement the following methods in GtkDrawingArea object: --- widgetRegionIntersect --- -- | -- Maintainer : gtk...@li... -- Stability : provisional @@ -44,7 +37,7 @@ -- Base class for all widgets -- module Graphics.UI.Gtk.Abstract.Widget ( --- * Description +-- * Detail -- -- | 'Widget' introduces style properties - these are basically object -- properties that are stored not on the object, but in the style object @@ -59,9 +52,10 @@ -- | 'GObject' -- | +----'Object' -- | +----Widget --- | +----'Misc' -- | +----'Container' +-- | +----'Misc' -- | +----'Calendar' +-- | +----'CellView' -- | +----'DrawingArea' -- | +----'Entry' -- | +----'Ruler' @@ -93,6 +87,8 @@ widgetCreateLayout, -- Drawing text. widgetQueueDraw, -- Functions to be used with DrawingArea. widgetHasIntersection, + widgetIntersect, + widgetRegionIntersect, widgetActivate, -- Manipulate widget state. widgetSetSensitivity, widgetSetSizeRequest, @@ -110,6 +106,30 @@ widgetQueueDrawArea, widgetSetDoubleBuffered, widgetSetRedrawOnAllocate, + widgetGetPointer, + widgetPath, + widgetClassPath, + widgetGetCompositeName, + widgetSetCompositeName, + widgetModifyStyle, + widgetGetModifierStyle, + widgetModifyFg, + widgetModifyBg, + widgetModifyText, + widgetModifyBase, + widgetModifyFont, + widgetGetParentWindow, + widgetSetExtensionEvents, + widgetGetExtensionEvents, + widgetGetEvents, + widgetTranslateCoordinates, + widgetSetDefaultDirection, + widgetGetDefaultDirection, + widgetCreatePangoContext, + widgetGetPangoContext, + widgetRenderIcon, + widgetGetParent, + widgetGetSizeRequest, -- * Properties widgetExtensionEvents, @@ -189,6 +209,7 @@ ) where import Monad (liftM, unless) +import Maybe (fromMaybe) import System.Glib.FFI import System.Glib.UTFString @@ -198,10 +219,13 @@ {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} import Graphics.UI.Gtk.Gdk.Enums -import Graphics.UI.Gtk.General.Structs (Allocation, Rectangle(..), Requisition(..), - widgetGetState, widgetGetSavedState) +{#import Graphics.UI.Gtk.Gdk.Region#} (Region(..), makeNewRegion) +import Graphics.UI.Gtk.General.Structs (Allocation, Rectangle(..) + ,Requisition(..), Color, IconSize, + ,widgetGetState, widgetGetSavedState) import Graphics.UI.Gtk.Gdk.Events (Event(..), marshalEvent) import Graphics.UI.Gtk.General.Enums (StateType(..), TextDirection(..)) +{#import Graphics.UI.Gtk.Pango.Types#} (FontDescription(FontDescription)) {# context lib="gtk" prefix="gtk" #} @@ -319,12 +343,49 @@ -> IO Bool -- ^ returns @True@ if there was an intersection widgetHasIntersection self area = liftM toBool $ - withObject area $ \areaPtr -> + with area $ \areaPtr -> {# call unsafe widget_intersect #} (toWidget self) (castPtr areaPtr) (castPtr nullPtr) +-- | Computes the intersection of a widget's area and @area@, returning the +-- intersection, and returns @Nothing@ if there was no intersection. +-- +widgetIntersect :: WidgetClass self => self + -> Rectangle -- ^ @area@ - a rectangle + -> IO (Maybe Rectangle) -- ^ returns the intersection or @Nothing@ +widgetIntersect self area = + with area $ \areaPtr -> + alloca $ \intersectionPtr -> do + hasIntersection <- {# call unsafe widget_intersect #} + (toWidget self) + (castPtr areaPtr) + (castPtr intersectionPtr) + if (toBool hasIntersection) + then liftM Just $ peek intersectionPtr + else return Nothing + +-- | Computes the intersection of a widget's area and @region@, returning +-- the intersection. The result may be empty, use 'regionEmpty' to check. +-- +widgetRegionIntersect :: WidgetClass self => self + -> Region -- ^ @region@ - a 'Region' in the same coordinate system as the + -- widget's allocation. That is, relative to the widget's + -- 'DrawWindow' for 'NoWindow' widgets; relative to the parent + -- 'DrawWindow' of the widget's 'DrawWindow' for widgets with + -- their own 'DrawWindow'. + -> IO Region -- ^ returns A region holding the intersection of the widget and + -- @region@. The coordinates of the return value are relative to + -- the widget's 'DrawWindow' for 'NoWindow' widgets, and relative + -- to the parent 'DrawWindow' of the widget's 'DrawWindow' for + -- widgets with their own 'DrawWindow'. +widgetRegionIntersect self region = do + intersectionPtr <- {# call gtk_widget_region_intersect #} + (toWidget self) + region + makeNewRegion intersectionPtr + -- Manipulate widget state. -- | For widgets that can be \"activated\" (buttons, menu items, etc.) this @@ -388,6 +449,26 @@ (fromIntegral width) (fromIntegral height) +-- | Gets the size request that was explicitly set for the widget using +-- 'widgetSetSizeRequest'. A value of -1 for @width@ or @height@ +-- indicates that that dimension has not been set explicitly and the natural +-- requisition of the widget will be used intead. See 'widgetSetSizeRequest'. +-- To get the size a widget will actually use, call 'widgetSizeRequest' instead +-- of this function. +-- +widgetGetSizeRequest :: WidgetClass self => self + -> IO (Int, Int) -- ^ @(width, height)@ +widgetGetSizeRequest self = + alloca $ \widthPtr -> + alloca $ \heightPtr -> do + {# call gtk_widget_get_size_request #} + (toWidget self) + widthPtr + heightPtr + width <- peek widthPtr + height <- peek heightPtr + return (fromIntegral width, fromIntegral height) + -- | Determines if the widget is the focus widget within its toplevel. -- widgetIsFocus :: WidgetClass self => self @@ -435,8 +516,7 @@ -- | Retrieves the name of a widget. See 'widgetSetName' for the significance -- of widget names. -- -widgetGetName :: WidgetClass self => self - -> IO String +widgetGetName :: WidgetClass self => self -> IO String widgetGetName self = {# call unsafe widget_get_name #} (toWidget self) @@ -530,9 +610,7 @@ -- If the direction is set to 'TextDirNone', then the value set by -- 'widgetSetDefaultDirection' will be used. -- -widgetSetDirection :: WidgetClass self => self - -> TextDirection - -> IO () +widgetSetDirection :: WidgetClass self => self -> TextDirection -> IO () widgetSetDirection self dir = {# call widget_set_direction #} (toWidget self) @@ -541,8 +619,7 @@ -- | Gets the reading direction for a particular widget. See -- 'widgetSetDirection'. -- -widgetGetDirection :: WidgetClass self => self - -> IO TextDirection +widgetGetDirection :: WidgetClass self => self -> IO TextDirection widgetGetDirection self = liftM (toEnum . fromIntegral) $ {# call widget_get_direction #} @@ -625,6 +702,351 @@ (toWidget self) (fromBool redrawOnAllocate) +-- | Gets the widget's parent window. +-- +widgetGetParentWindow :: WidgetClass self => self -> IO DrawWindow +widgetGetParentWindow self = + makeNewGObject mkDrawWindow $ + {# call gtk_widget_get_parent_window #} + (toWidget self) + +-- | Obtains the location of the mouse pointer in widget coordinates. Widget +-- coordinates are a bit odd; for historical reasons, they are defined as +-- 'widgetGetParentWindow' coordinates for widgets that are not 'NoWindow' widgets, +-- and are relative to the widget's allocation's (x,y) for +-- widgets that are 'NoWindow' widgets. +-- +widgetGetPointer :: WidgetClass self => self + -> IO (Int, Int) -- ^ @(x, y)@ - X Y coordinate +widgetGetPointer self = + alloca $ \xPtr -> + alloca $ \yPtr -> + {# call gtk_widget_get_pointer #} + (toWidget self) + xPtr + yPtr + >> + peek xPtr >>= \x -> + peek yPtr >>= \y -> + return (fromIntegral x, fromIntegral y) + +-- | Translate coordinates relative to @srcWidget@'s allocation to coordinates +-- relative to @destWidget@'s allocations. In order to perform this operation, +-- both widgets must be realized, and must share a common toplevel. +-- +widgetTranslateCoordinates :: (WidgetClass self, WidgetClass destWidget) => + self -- ^ @srcWidget@ - a 'Widget' + -> destWidget -- ^ @destWidget@ - a 'Widget' + -> Int -- ^ @srcX@ - X position relative to @srcWidget@ + -> Int -- ^ @srcY@ - Y position relative to @srcWidget@ + -> IO (Maybe (Int, Int)) -- ^ @Just (destX, destY)@ - X and Y position + -- relative to @destWidget@. Returns @Nothing@ if + -- either widget was not realized, or there was no + -- common ancestor. +widgetTranslateCoordinates self destWidget srcX srcY = + alloca $ \destXPtr -> + alloca $ \destYPtr -> do + worked <- {# call gtk_widget_translate_coordinates #} + (toWidget self) + (toWidget destWidget) + (fromIntegral srcX) + (fromIntegral srcY) + destXPtr + destYPtr + if (toBool worked) + then do destX <- peek destXPtr + destY <- peek destYPtr + return (Just (fromIntegral destX, fromIntegral destY)) + else return Nothing + +-- | Obtains the full path to the widget. The path is simply the name of a +-- widget and all its parents in the container hierarchy, separated by periods. +-- The name of a widget comes from 'widgetGetName'. Paths are used to apply +-- styles to a widget in gtkrc configuration files. Widget names are the type +-- of the widget by default (e.g. \"GtkButton\") or can be set to an +-- application-specific value with 'widgetSetName'. By setting the name of a +-- widget, you allow users or theme authors to apply styles to that specific +-- widget in their gtkrc file. Also returns the path in reverse +-- order, i.e. starting with the widget's name instead of starting with the +-- name of the widget's outermost ancestor. +-- +widgetPath :: WidgetClass self => self + -> IO (Int, String, String) -- ^ @(pathLength, path, pathReversed)@ - length + -- of the path, path string and reverse path + -- string +widgetPath self = + alloca $ \pathLengthPtr -> + alloca $ \pathPtr -> + alloca $ \pathReversedPtr -> + {# call gtk_widget_path #} + (toWidget self) + pathLengthPtr + pathPtr + pathReversedPtr + >> + peek pathLengthPtr >>= \pathLength -> + peek pathPtr >>= readUTFString >>= \path -> + peek pathReversedPtr >>= readUTFString >>= \pathReversed -> + return (fromIntegral pathLength, path, pathReversed) + +-- | Same as 'widgetPath', but always uses the name of a widget's type, never +-- uses a custom name set with 'widgetSetName'. +-- +widgetClassPath :: WidgetClass self => self + -> IO (Int, String, String) -- ^ @(pathLength, path, pathReversed)@ - length + -- of the path, path string and reverse path + -- string +widgetClassPath self = + alloca $ \pathLengthPtr -> + alloca $ \pathPtr -> + alloca $ \pathReversedPtr -> + {# call gtk_widget_class_path #} + (toWidget self) + pathLengthPtr + pathPtr + pathReversedPtr + >> + peek pathLengthPtr >>= \pathLength -> + peek pathPtr >>= readUTFString >>= \path -> + peek pathReversedPtr >>= readUTFString >>= \pathReversed -> + return (fromIntegral pathLength, path, pathReversed) + +-- | Obtains the composite name of a widget. +-- +widgetGetCompositeName :: WidgetClass self => self + -> IO (Maybe String) -- ^ returns the composite name of @widget@, or + -- @Nothing@ if @widget@ is not a composite child. +widgetGetCompositeName self = + {# call gtk_widget_get_composite_name #} + (toWidget self) + >>= maybePeek peekUTFString + +-- | Sets a widgets composite name. The widget must be a composite child of +-- its parent; see 'widgetPushCompositeChild'. +-- +widgetSetCompositeName :: WidgetClass self => self + -> String -- ^ @name@ - the name to set. + -> IO () +widgetSetCompositeName self name = + withUTFString name $ \namePtr -> + {# call gtk_widget_set_composite_name #} + (toWidget self) + namePtr + +-- | Returns the parent container of @widget@. +-- +widgetGetParent :: WidgetClass self => self + -> IO Widget -- ^ returns the parent container of @widget@, or {@NULL@, + -- FIXME: this should probably be converted to a Maybe data type} +widgetGetParent self = + makeNewObject mkWidget $ + {# call gtk_widget_get_parent #} + (toWidget self) + +-- | Sets the default reading direction for widgets where the direction has +-- not been explicitly set by 'widgetSetDirection'. +-- +widgetSetDefaultDirection :: + TextDirection -- ^ @dir@ - the new default direction. This cannot be + -- 'TextDirNone'. + -> IO () +widgetSetDefaultDirection dir = + {# call gtk_widget_set_default_direction #} + ((fromIntegral . fromEnum) dir) + +-- | Obtains the current default reading direction. See +-- 'widgetSetDefaultDirection'. +-- +widgetGetDefaultDirection :: IO TextDirection +widgetGetDefaultDirection = + liftM (toEnum . fromIntegral) $ + {# call gtk_widget_get_default_direction #} + +-- | Modifies style values on the widget. Modifications made using this +-- technique take precedence over style values set via an RC file, however, +-- they will be overriden if a style is explicitely set on the widget using +-- 'widgetSetStyle'. The 'RcStyle' structure is designed so each field can +-- either be set or unset, so it is possible, using this function, to modify +-- some style values and leave the others unchanged. +-- +-- Note that modifications made with this function are not cumulative with +-- previous calls to 'widgetModifyStyle' or with such functions as +-- 'widgetModifyFg'. If you wish to retain previous values, you must first call +-- 'widgetGetModifierStyle', make your modifications to the returned style, +-- then call 'widgetModifyStyle' with that style. On the other hand, if you +-- first call 'widgetModifyStyle', subsequent calls to such functions +-- 'widgetModifyFg' will have a cumulative effect with the initial +-- modifications. +-- +widgetModifyStyle :: (WidgetClass self, RcStyleClass style) => self + -> style -- ^ @style@ - the 'RcStyle' holding the style modifications + -> IO () +widgetModifyStyle self style = + {# call gtk_widget_modify_style #} + (toWidget self) + (toRcStyle style) + +-- | Returns the current modifier style for the widget. (As set by +-- 'widgetModifyStyle'.) If no style has previously set, a new 'RcStyle' will +-- be created with all values unset, and set as the modifier style for the +-- widget. If you make changes to this rc style, you must call +-- 'widgetModifyStyle', passing in the returned rc style, to make sure that +-- your changes take effect. +-- +-- Caution: passing the style back to 'widgetModifyStyle' will normally end +-- up destroying it, because 'widgetModifyStyle' copies the passed-in style and +-- sets the copy as the new modifier style, thus dropping any reference to the +-- old modifier style. Add a reference to the modifier style if you want to +-- keep it alive. +-- +widgetGetModifierStyle :: WidgetClass self => self -> IO RcStyle +widgetGetModifierStyle self = + makeNewGObject mkRcStyle $ + {# call gtk_widget_get_modifier_style #} + (toWidget self) + +-- | Sets the foreground color for a widget in a particular state. All other +-- style values are left untouched. See also 'widgetModifyStyle'. +-- +widgetModifyFg :: WidgetClass self => self + -> StateType -- ^ @state@ - the state for which to set the foreground color. + -> Color -- ^ @color@ - the color to assign (does not need to be + -- allocated), or @Nothing@ to undo the effect of previous calls + -- to of 'widgetModifyFg'. + -> IO () +widgetModifyFg self state color = + with color $ \colorPtr -> + {# call gtk_widget_modify_fg #} + (toWidget self) + ((fromIntegral . fromEnum) state) + (castPtr colorPtr) + +-- | Sets the background color for a widget in a particular state. All other +-- style values are left untouched. See also 'widgetModifyStyle'. +-- +widgetModifyBg :: WidgetClass self => self + -> StateType -- ^ @state@ - the state for which to set the background color. + -> Color -- ^ @color@ - the color to assign (does not need to be + -- allocated), or @Nothing@ to undo the effect of previous calls + -- to of 'widgetModifyBg'. + -> IO () +widgetModifyBg self state color = + with color $ \colorPtr -> + {# call gtk_widget_modify_bg #} + (toWidget self) + ((fromIntegral . fromEnum) state) + (castPtr colorPtr) + +-- | Sets the text color for a widget in a particular state. All other style +-- values are left untouched. The text color is the foreground color used along +-- with the base color (see 'widgetModifyBase') for widgets such as 'Entry' and +-- 'TextView'. See also 'widgetModifyStyle'. +-- +widgetModifyText :: WidgetClass self => self + -> StateType -- ^ @state@ - the state for which to set the text color. + -> Color -- ^ @color@ - the color to assign (does not need to be + -- allocated), or @Nothing@ to undo the effect of previous calls + -- to of 'widgetModifyText'. + -> IO () +widgetModifyText self state color = + with color $ \colorPtr -> + {# call gtk_widget_modify_text #} + (toWidget self) + ((fromIntegral . fromEnum) state) + (castPtr colorPtr) + +-- | Sets the base color for a widget in a particular state. All other style +-- values are left untouched. The base color is the background color used along +-- with the text color (see 'widgetModifyText') for widgets such as 'Entry' and +-- 'TextView'. See also 'widgetModifyStyle'. +-- +widgetModifyBase :: WidgetClass self => self + -> StateType -- ^ @state@ - the state for which to set the base color. + -> Color -- ^ @color@ - the color to assign (does not need to be + -- allocated), or @Nothing@ to undo the effect of previous calls + -- to of 'widgetModifyBase'. + -> IO () +widgetModifyBase self state color = + with color $ \colorPtr -> + {# call gtk_widget_modify_base #} + (toWidget self) + ((fromIntegral . fromEnum) state) + (castPtr colorPtr) + +-- | Sets the font to use for a widget. All other style values are left +-- untouched. See also 'widgetModifyStyle'. +-- +widgetModifyFont :: WidgetClass self => self + -> Maybe FontDescription -- ^ @fontDesc@ - the font description to use, or + -- @Nothing@ to undo the effect of previous calls to + -- 'widgetModifyFont'. + -> IO () +widgetModifyFont self fontDesc = + {# call gtk_widget_modify_font #} + (toWidget self) + (fromMaybe (FontDescription nullForeignPtr) fontDesc) + +-- | Creates a new 'Context' with the appropriate colormap, font description, +-- and base direction for drawing text for this widget. See also +-- 'widgetGetPangoContext'. +-- +widgetCreatePangoContext :: WidgetClass self => self + -> IO PangoContext -- ^ returns the new 'PangoContext' +widgetCreatePangoContext self = + makeNewGObject mkPangoContext $ + {# call gtk_widget_create_pango_context #} + (toWidget self) + +-- | Gets a 'Context' with the appropriate colormap, font description and base +-- direction for this widget. Unlike the context returned by +-- 'widgetCreatePangoContext', this context is owned by the widget (it can be +-- used until the screen for the widget changes or the widget is removed from +-- its toplevel), and will be updated to match any changes to the widget's +-- attributes. +-- +-- If you create and keep a 'PangoLayout' using this context, you must deal +-- with changes to the context by calling 'layoutContextChanged' on the layout +-- in response to the ::style-set and ::direction-changed signals for the +-- widget. +-- +widgetGetPangoContext :: WidgetClass self => self + -> IO PangoContext -- ^ returns the 'PangoContext' for the widget. +widgetGetPangoContext self = + makeNewGObject mkPangoContext $ + {# call gtk_widget_get_pango_context #} + (toWidget self) + +-- | A convenience function that uses the theme engine and RC file settings +-- for @widget@ to look up @stockId@ and render it to a pixbuf. @stockId@ +-- should be a stock icon ID such as {GTK_STOCK_OPEN, FIXME: unknown +-- type/value} or {GTK_STOCK_OK, FIXME: unknown type/value}. @size@ should be a +-- size such as 'IconSizeMenu'. @detail@ should be a string that identifies the +-- widget or code doing the rendering, so that theme engines can special-case +-- rendering for that widget or code. +-- +-- The pixels in the returned 'Pixbuf' are shared with the rest of the +-- application and should not be modified. The pixbuf should be freed after use +-- with 'gObjectUnref'. +-- +widgetRenderIcon :: WidgetClass self => self + -> String -- ^ @stockId@ - a stock ID + -> IconSize -- ^ @size@ - a stock size. A size of (GtkIconSize)-1 means + -- render at the size of the source and don't scale (if there are + -- multiple source sizes, Gtk+ picks one of the available sizes). + -> String -- ^ @detail@ - render detail to pass to theme engine + -> IO Pixbuf -- ^ returns a new pixbuf, or {@NULL@, FIXME: this should + -- probably be converted to a Maybe data type} if the stock ID + -- wasn't known +widgetRenderIcon self stockId size detail = + makeNewGObject mkPixbuf $ + withUTFString detail $ \detailPtr -> + withUTFString stockId $ \stockIdPtr -> + {# call gtk_widget_render_icon #} + (toWidget self) + stockIdPtr + ((fromIntegral . fromEnum) size) + detailPtr + -------------------- -- Properties Index: Paned.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Abstract/Paned.chs.pp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Paned.chs.pp 2 Apr 2005 19:02:22 -0000 1.7 +++ Paned.chs.pp 7 Apr 2005 00:13:59 -0000 1.8 @@ -83,7 +83,21 @@ #endif -- * Properties - panedPosition + panedPosition, + +-- * Signals + onCycleChildFocus, + afterCycleChildFocus, + onToggleHandleFocus, + afterToggleHandleFocus, + onMoveHandle, + afterMoveHandle, + onCycleHandleFocus, + afterCycleHandleFocus, + onAcceptPosition, + afterAcceptPosition, + onCancelPosition, + afterCancelPosition, ) where import Monad (liftM) @@ -93,6 +107,7 @@ import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} +import Graphics.UI.Gtk.General.Enums (ScrollType) {# context lib="gtk" prefix="gtk" #} @@ -209,3 +224,54 @@ panedPosition = Attr panedGetPosition panedSetPosition + +-------------------- +-- Signals + +-- | +-- +onCycleChildFocus, afterCycleChildFocus :: PanedClass self => self + -> (Bool -> IO Bool) + -> IO (ConnectId self) +onCycleChildFocus = connect_BOOL__BOOL "cycle_child_focus" False +afterCycleChildFocus = connect_BOOL__BOOL "cycle_child_focus" True + +-- | +-- +onToggleHandleFocus, afterToggleHandleFocus :: PanedClass self => self + -> IO Bool + -> IO (ConnectId self) +onToggleHandleFocus = connect_NONE__BOOL "toggle_handle_focus" False +afterToggleHandleFocus = connect_NONE__BOOL "toggle_handle_focus" True + +-- | +-- +onMoveHandle, afterMoveHandle :: PanedClass self => self + -> (ScrollType -> IO Bool) + -> IO (ConnectId self) +onMoveHandle = connect_ENUM__BOOL "move_handle" False +afterMoveHandle = connect_ENUM__BOOL "move_handle" True + +-- | +-- +onCycleHandleFocus, afterCycleHandleFocus :: PanedClass self => self + -> (Bool -> IO Bool) + -> IO (ConnectId self) +onCycleHandleFocus = connect_BOOL__BOOL "cycle_handle_focus" False +afterCycleHandleFocus = connect_BOOL__BOOL "cycle_handle_focus" True + +-- | +-- +onAcceptPosition, afterAcceptPosition :: PanedClass self => self + -> IO Bool + -> IO (ConnectId self) +onAcceptPosition = connect_NONE__BOOL "accept_position" False +afterAcceptPosition = connect_NONE__BOOL "accept_position" True + +-- | +-- +onCancelPosition, afterCancelPosition :: PanedClass self => self + -> IO Bool + -> IO (ConnectId self) +onCancelPosition = connect_NONE__BOOL "cancel_position" False +afterCancelPosition = connect_NONE__BOOL "cancel_position" True Index: Scrollbar.hs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Abstract/Scrollbar.hs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Scrollbar.hs 14 Mar 2005 23:55:07 -0000 1.3 +++ Scrollbar.hs 7 Apr 2005 00:13:59 -0000 1.4 @@ -31,6 +31,15 @@ -- -- | The 'Scrollbar' widget is an abstract base class for 'HScrollbar' and -- 'VScrollbar'. It is not very useful in itself. +-- +-- The position of the thumb in a scrollbar is controlled by the scroll +-- adjustments. See 'Adjustment' for the fields in an adjustment - for +-- 'Scrollbar', the \"value\" field represents the position of the scrollbar, +-- which must be between the \"lower\" field and \"upper - page_size.\" The +-- \"page_size\" field represents the size of the visible scrollable area. The +-- \"step_increment\" and \"page_increment\" fields are used when the user asks +-- to step down (using the small stepper arrows) or page down (using for +-- example the PageDown key). -- * Class Hierarchy -- | |