You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(4) |
Jun
|
Jul
(68) |
Aug
(4) |
Sep
|
Oct
(23) |
Nov
(95) |
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(3) |
Feb
|
Mar
|
Apr
(51) |
May
(81) |
Jun
(2) |
Jul
(86) |
Aug
(143) |
Sep
(3) |
Oct
(31) |
Nov
(63) |
Dec
(90) |
2005 |
Jan
(277) |
Feb
(157) |
Mar
(99) |
Apr
(195) |
May
(151) |
Jun
(148) |
Jul
(98) |
Aug
(123) |
Sep
(20) |
Oct
(174) |
Nov
(155) |
Dec
(26) |
2006 |
Jan
(51) |
Feb
(19) |
Mar
(16) |
Apr
(12) |
May
(5) |
Jun
|
Jul
(11) |
Aug
(7) |
Sep
(10) |
Oct
(31) |
Nov
(174) |
Dec
(56) |
2007 |
Jan
(45) |
Feb
(52) |
Mar
(10) |
Apr
(5) |
May
(47) |
Jun
(16) |
Jul
(80) |
Aug
(29) |
Sep
(14) |
Oct
(59) |
Nov
(46) |
Dec
(16) |
2008 |
Jan
(10) |
Feb
(1) |
Mar
|
Apr
|
May
(49) |
Jun
(26) |
Jul
(8) |
Aug
(4) |
Sep
(25) |
Oct
(53) |
Nov
(9) |
Dec
(1) |
2009 |
Jan
(66) |
Feb
(11) |
Mar
(1) |
Apr
(14) |
May
(8) |
Jun
(1) |
Jul
(2) |
Aug
(2) |
Sep
(9) |
Oct
(23) |
Nov
(35) |
Dec
|
2010 |
Jan
(7) |
Feb
(2) |
Mar
(39) |
Apr
(19) |
May
(161) |
Jun
(19) |
Jul
(32) |
Aug
(65) |
Sep
(113) |
Oct
(120) |
Nov
(2) |
Dec
|
2012 |
Jan
|
Feb
(5) |
Mar
(4) |
Apr
(7) |
May
(9) |
Jun
(14) |
Jul
(1) |
Aug
|
Sep
(1) |
Oct
(1) |
Nov
(12) |
Dec
(2) |
2013 |
Jan
(1) |
Feb
(17) |
Mar
(4) |
Apr
(4) |
May
(9) |
Jun
|
Jul
(8) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
From: Duncan C. <dun...@us...> - 2005-03-15 19:59:32
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Entry In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5160/gtk/Graphics/UI/Gtk/Entry Modified Files: Entry.chs.pp EntryCompletion.chs.pp HScale.chs SpinButton.chs VScale.chs Log Message: Documentation changes and code formatting changes. Index: VScale.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Entry/VScale.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- VScale.chs 25 Feb 2005 01:11:33 -0000 1.3 +++ VScale.chs 15 Mar 2005 19:59:12 -0000 1.4 @@ -24,10 +24,10 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- A vertical slider widget for selecting a value from a range. +-- A vertical slider widget for selecting a value from a range -- module Graphics.UI.Gtk.Entry.VScale ( --- * Description +-- * Detail -- -- | The 'VScale' widget is used to allow the user to select a value using a -- vertical slider. To create one, use 'hScaleNewWithRange'. @@ -68,21 +68,31 @@ -------------------- -- Constructors --- | Create a new VScale widget. +-- | Creates a new 'VScale'. -- -vScaleNew :: Adjustment -> IO VScale -vScaleNew adj = makeNewObject mkVScale $ liftM castPtr $ - {#call unsafe vscale_new#} adj +vScaleNew :: + Adjustment -- ^ @adjustment@ - the 'Adjustment' which sets the range of + -- the scale. + -> IO VScale +vScaleNew adjustment = + makeNewObject mkVScale $ liftM castPtr $ + {# call unsafe vscale_new #} + adjustment --- | Create a new VScale widget with @min@, @max@ and @step@ values rather than --- an "Adjustment" object. +-- | Creates a new vertical scale widget that lets the user input a number +-- between @min@ and @max@ (including @min@ and @max@) with the increment +-- @step@. @step@ must be nonzero; it's the distance the slider moves when +-- using the arrow keys to adjust the scale value. -- -vScaleNewWithRange :: Double -- ^ Minimum value - -> Double -- ^ Maximum value - -> Double -- ^ Step increment (tick size) used with keyboard - -- shortcuts. Must be nonzero. - -> IO VScale +vScaleNewWithRange :: + Double -- ^ @min@ - minimum value + -> Double -- ^ @max@ - maximum value + -> Double -- ^ @step@ - step increment (tick size) used with keyboard + -- shortcuts. Must be nonzero. + -> IO VScale vScaleNewWithRange min max step = makeNewObject mkVScale $ liftM castPtr $ - {#call unsafe vscale_new_with_range#} (realToFrac min) (realToFrac max) + {# call unsafe vscale_new_with_range #} + (realToFrac min) + (realToFrac max) (realToFrac step) Index: SpinButton.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Entry/SpinButton.chs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- SpinButton.chs 13 Mar 2005 19:34:33 -0000 1.5 +++ SpinButton.chs 15 Mar 2005 19:59:12 -0000 1.6 @@ -122,185 +122,287 @@ -------------------- -- Constructors --- | Create a new SpinButton. --- --- * @climbRate@ is the amount by which the value is changed each time --- the up\/down buttons are pressed. --- --- * @digits@ is the number of shown digits. Set to 0 to work with --- integer values. +-- | Creates a new 'SpinButton'. -- -spinButtonNew :: Adjustment -> Double -> Int -> IO SpinButton -spinButtonNew adj climbRate digits = makeNewObject mkSpinButton $ - liftM castPtr $ {#call unsafe spin_button_new#} adj (realToFrac climbRate) - (fromIntegral digits) +spinButtonNew :: + Adjustment -- ^ @adjustment@ - the 'Adjustment' object that this spin + -- button should use. + -> Double -- ^ @climbRate@ - specifies how much the spin button + -- changes when an arrow is clicked on. + -> Int -- ^ @digits@ - the number of decimal places to display. + -> IO SpinButton +spinButtonNew adjustment climbRate digits = + makeNewObject mkSpinButton $ liftM castPtr $ + {# call unsafe spin_button_new #} + adjustment + (realToFrac climbRate) + (fromIntegral digits) --- | Create a new SpinButton with a restricted --- range. --- --- * This is a convenience function because the user does not have to create --- an Adjustment first. Page increments are set to 10 * @step@. +-- | This is a convenience constructor that allows creation of a numeric +-- 'SpinButton' without manually creating an adjustment. The value is initially +-- set to the minimum value and a page increment of 10 * @step@ is the default. +-- The precision of the spin button is equivalent to the precision of @step@. -- -spinButtonNewWithRange :: Double -> Double -> Double -> IO SpinButton -spinButtonNewWithRange min max step = makeNewObject mkSpinButton $ - liftM castPtr $ {#call unsafe spin_button_new_with_range#} - (realToFrac min) (realToFrac max) (realToFrac step) +spinButtonNewWithRange :: + Double -- ^ @min@ - Minimum allowable value + -> Double -- ^ @max@ - Maximum allowable value + -> Double -- ^ @step@ - Increment added or subtracted by spinning the + -- widget + -> IO SpinButton +spinButtonNewWithRange min max step = + makeNewObject mkSpinButton $ liftM castPtr $ + {# call unsafe spin_button_new_with_range #} + (realToFrac min) + (realToFrac max) + (realToFrac step) -------------------- -- Methods --- | Change the settings of a SpinButton. +-- | Changes the properties of an existing spin button. The adjustment, climb +-- rate, and number of decimal places are all changed accordingly, after this +-- function call. -- -spinButtonConfigure :: SpinButtonClass sb => sb -> Adjustment -> Double -> - Int -> IO () -spinButtonConfigure sb adj climbRate digits = {#call spin_button_configure#} - (toSpinButton sb) adj (realToFrac climbRate) (fromIntegral digits) +spinButtonConfigure :: SpinButtonClass self => self + -> Adjustment -- ^ @adjustment@ - a 'Adjustment'. + -> Double -- ^ @climbRate@ - the new climb rate. + -> Int -- ^ @digits@ - the number of decimal places to display in the + -- spin button. + -> IO () +spinButtonConfigure self adjustment climbRate digits = + {# call spin_button_configure #} + (toSpinButton self) + adjustment + (realToFrac climbRate) + (fromIntegral digits) --- | Attach a new Adjustment object to the --- SpinButton. +-- | Replaces the 'Adjustment' associated with the spin button. -- -spinButtonSetAdjustment :: SpinButtonClass sb => sb -> Adjustment -> IO () -spinButtonSetAdjustment sb adj = {#call spin_button_set_adjustment#} - (toSpinButton sb) adj +spinButtonSetAdjustment :: SpinButtonClass self => self + -> Adjustment -- ^ @adjustment@ - a 'Adjustment' to replace the existing + -- adjustment + -> IO () +spinButtonSetAdjustment self adjustment = + {# call spin_button_set_adjustment #} + (toSpinButton self) + adjustment --- | Retrieve the Adjustment object that is --- currently controlling the SpinButton. +-- | Get the adjustment associated with a 'SpinButton' -- -spinButtonGetAdjustment :: SpinButtonClass sb => sb -> IO Adjustment -spinButtonGetAdjustment sb = makeNewObject mkAdjustment $ - {#call unsafe spin_button_get_adjustment#} (toSpinButton sb) +spinButtonGetAdjustment :: SpinButtonClass self => self + -> IO Adjustment -- ^ returns the 'Adjustment' of @spinButton@ +spinButtonGetAdjustment self = + makeNewObject mkAdjustment $ + {# call unsafe spin_button_get_adjustment #} + (toSpinButton self) --- | Sets the number of shown digits. +-- | Set the precision to be displayed by @spinButton@. Up to 20 digit +-- precision is allowed. -- -spinButtonSetDigits :: SpinButtonClass sb => sb -> Int -> IO () -spinButtonSetDigits sb digits = {#call spin_button_set_digits#} - (toSpinButton sb) (fromIntegral digits) +spinButtonSetDigits :: SpinButtonClass self => self + -> Int -- ^ @digits@ - the number of digits after the decimal point to be + -- displayed for the spin button's value + -> IO () +spinButtonSetDigits self digits = + {# call spin_button_set_digits #} + (toSpinButton self) + (fromIntegral digits) --- | Gets the number of digits shown. +-- | Fetches the precision of @spinButton@. See 'spinButtonSetDigits'. -- -spinButtonGetDigits :: SpinButtonClass sb => sb -> IO Int -spinButtonGetDigits sb = liftM fromIntegral $ - {#call spin_button_get_digits#} (toSpinButton sb) +spinButtonGetDigits :: SpinButtonClass self => self + -> IO Int -- ^ returns the current precision +spinButtonGetDigits self = + liftM fromIntegral $ + {# call spin_button_get_digits #} + (toSpinButton self) --- | Sets the increment for up\/down buttons. +-- | Sets the step and page increments for the spin button. This affects how +-- quickly the value changes when the spin button's arrows are activated. -- -spinButtonSetIncrements :: SpinButtonClass sb => sb -> Double -> Double -> - IO () -spinButtonSetIncrements sb step page = {#call spin_button_set_increments#} - (toSpinButton sb) (realToFrac step) (realToFrac page) +spinButtonSetIncrements :: SpinButtonClass self => self + -> Double -- ^ @step@ - increment applied for a button 1 press. + -> Double -- ^ @page@ - increment applied for a button 2 press. + -> IO () +spinButtonSetIncrements self step page = + {# call spin_button_set_increments #} + (toSpinButton self) + (realToFrac step) + (realToFrac page) --- | Sets the increment for up\/down buttons. +-- | Gets the current step and page the increments used by the spin button. See +-- 'spinButtonSetIncrements'. -- -spinButtonGetIncrements :: SpinButtonClass sb => sb -> IO (Double, Double) -spinButtonGetIncrements sb = - alloca $ \stepPtr -> alloca $ \pagePtr -> do - {#call unsafe spin_button_get_increments#} (toSpinButton sb) stepPtr pagePtr +spinButtonGetIncrements :: SpinButtonClass self => self + -> IO (Double, Double) -- ^ @(step, page)@ +spinButtonGetIncrements self = + alloca $ \stepPtr -> + alloca $ \pagePtr -> do + {# call unsafe spin_button_get_increments #} + (toSpinButton self) + stepPtr + pagePtr step <- peek stepPtr page <- peek pagePtr return (realToFrac step, realToFrac page) --- | Set the maximal allowable range for the spinbutton. +-- | Sets the minimum and maximum allowable values for the spin button -- -spinButtonSetRange :: SpinButtonClass sb => sb -> Double -> Double -> IO () -spinButtonSetRange sb min max = {#call spin_button_set_range#} - (toSpinButton sb) (realToFrac min) (realToFrac max) +spinButtonSetRange :: SpinButtonClass self => self + -> Double -- ^ @min@ - minimum allowable value + -> Double -- ^ @max@ - maximum allowable value + -> IO () +spinButtonSetRange self min max = + {# call spin_button_set_range #} + (toSpinButton self) + (realToFrac min) + (realToFrac max) --- | Get the maximal allowable range for the spinbutton. +-- | Gets the range allowed for the spin button. See 'spinButtonSetRange'. -- -spinButtonGetRange :: SpinButtonClass sb => sb -> IO (Double, Double) -spinButtonGetRange sb = - alloca $ \minPtr -> alloca $ \maxPtr -> do - {#call unsafe spin_button_get_range#} (toSpinButton sb) minPtr maxPtr +spinButtonGetRange :: SpinButtonClass self => self + -> IO (Double, Double) -- ^ @(min, max)@ +spinButtonGetRange self = + alloca $ \minPtr -> + alloca $ \maxPtr -> do + {# call unsafe spin_button_get_range #} + (toSpinButton self) + minPtr + maxPtr min <- peek minPtr max <- peek maxPtr return (realToFrac min, realToFrac max) --- | Retrieve the current value as a floating point --- value. +-- | Retrieve the current value of the spin button as a floating point value. -- -spinButtonGetValue :: SpinButtonClass sb => sb -> IO Double -spinButtonGetValue sb = liftM realToFrac $ - {#call unsafe spin_button_get_value#} (toSpinButton sb) +spinButtonGetValue :: SpinButtonClass self => self -> IO Double +spinButtonGetValue self = + liftM realToFrac $ + {# call unsafe spin_button_get_value #} + (toSpinButton self) --- | Retrieve the current value as integral --- value. +-- | Retrieve the current value of the spin button as an integral value. -- -spinButtonGetValueAsInt :: SpinButtonClass sb => sb -> IO Int -spinButtonGetValueAsInt sb = liftM fromIntegral $ - {#call unsafe spin_button_get_value_as_int#} (toSpinButton sb) +spinButtonGetValueAsInt :: SpinButtonClass self => self -> IO Int +spinButtonGetValueAsInt self = + liftM fromIntegral $ + {# call unsafe spin_button_get_value_as_int #} + (toSpinButton self) -- | Set the value of the SpinButton. -- -spinButtonSetValue :: SpinButtonClass sb => sb -> Double -> IO () -spinButtonSetValue sb value = {#call spin_button_set_value#} - (toSpinButton sb) (realToFrac value) +spinButtonSetValue :: SpinButtonClass self => self -> Double -> IO () +spinButtonSetValue self value = + {# call spin_button_set_value #} + (toSpinButton self) + (realToFrac value) --- | Whether the an out-of-range value set by 'spinButtonSetValue' is clamped to --- the limits or simply ignored. +-- | Sets the update behavior of a spin button. This determines whether the +-- spin button is always updated or only when a valid value is set. -- -spinButtonSetUpdatePolicy :: SpinButtonClass sb => sb -> - SpinButtonUpdatePolicy -> IO () -spinButtonSetUpdatePolicy sb up = {#call spin_button_set_update_policy#} - (toSpinButton sb) ((fromIntegral.fromEnum) up) +spinButtonSetUpdatePolicy :: SpinButtonClass self => self + -> SpinButtonUpdatePolicy -- ^ @policy@ - a 'SpinButtonUpdatePolicy' value + -> IO () +spinButtonSetUpdatePolicy self policy = + {# call spin_button_set_update_policy #} + (toSpinButton self) + ((fromIntegral . fromEnum) policy) --- | Gets the update behavior of a spin button. See 'spinButtonSetUpdatePolicy'. +-- | Gets the update behavior of a spin button. See +-- 'spinButtonSetUpdatePolicy'. -- -spinButtonGetUpdatePolicy :: SpinButtonClass sb => sb - -> IO SpinButtonUpdatePolicy -spinButtonGetUpdatePolicy sb = liftM (toEnum.fromIntegral) $ - {#call unsafe spin_button_get_update_policy#} (toSpinButton sb) +spinButtonGetUpdatePolicy :: SpinButtonClass self => self + -> IO SpinButtonUpdatePolicy -- ^ returns the current update policy +spinButtonGetUpdatePolicy self = + liftM (toEnum . fromIntegral) $ + {# call unsafe spin_button_get_update_policy #} + (toSpinButton self) -- | Sets the flag that determines if non-numeric text can be typed into the -- spin button. -- -spinButtonSetNumeric :: SpinButtonClass sb => sb -> Bool -> IO () -spinButtonSetNumeric sb numeric = {#call spin_button_set_numeric#} - (toSpinButton sb) (fromBool numeric) +spinButtonSetNumeric :: SpinButtonClass self => self + -> Bool -- ^ @numeric@ - flag indicating if only numeric entry is allowed. + -> IO () +spinButtonSetNumeric self numeric = + {# call spin_button_set_numeric #} + (toSpinButton self) + (fromBool numeric) --- | Returns whether non-numeric text can be typed into the spin button. +-- | Returns whether non-numeric text can be typed into the spin button. See +-- 'spinButtonSetNumeric'. -- -spinButtonGetNumeric :: SpinButtonClass sb => sb -> IO Bool -spinButtonGetNumeric sb = - liftM toBool $ {#call unsafe spin_button_get_numeric#} (toSpinButton sb) +spinButtonGetNumeric :: SpinButtonClass self => self + -> IO Bool -- ^ returns @True@ if only numeric text can be entered +spinButtonGetNumeric self = + liftM toBool $ + {# call unsafe spin_button_get_numeric #} + (toSpinButton self) --- | Increment or decrement the current value of the SpinButton. +-- | Increment or decrement a spin button's value in a specified direction by +-- a specified amount. -- -spinButtonSpin :: SpinButtonClass sb => sb -> SpinType -> Double -> IO () -spinButtonSpin sb st offset = {#call spin_button_spin#} (toSpinButton sb) - ((fromIntegral.fromEnum) st) (realToFrac offset) +spinButtonSpin :: SpinButtonClass self => self + -> SpinType -- ^ @direction@ - a 'SpinType' indicating the direction to spin. + -> Double -- ^ @increment@ - step increment to apply in the specified + -- direction. + -> IO () +spinButtonSpin self direction increment = + {# call spin_button_spin #} + (toSpinButton self) + ((fromIntegral . fromEnum) direction) + (realToFrac increment) -- | Sets the flag that determines if a spin button value wraps around to the -- opposite limit when the upper or lower limit of the range is exceeded. -- -spinButtonSetWrap :: SpinButtonClass sb => sb -> Bool -> IO () -spinButtonSetWrap sb wrap = {#call spin_button_set_wrap#} (toSpinButton sb) - (fromBool wrap) +spinButtonSetWrap :: SpinButtonClass self => self + -> Bool -- ^ @wrap@ - a flag indicating if wrapping behavior is performed. + -> IO () +spinButtonSetWrap self wrap = + {# call spin_button_set_wrap #} + (toSpinButton self) + (fromBool wrap) --- | Returns whether the spin button's value wraps around to the opposite limit --- when the upper or lower limit of the range is exceeded. +-- | Returns whether the spin button's value wraps around to the opposite +-- limit when the upper or lower limit of the range is exceeded. See +-- 'spinButtonSetWrap'. -- -spinButtonGetWrap :: SpinButtonClass sb => sb -> IO Bool -spinButtonGetWrap sb = - liftM toBool $ {#call spin_button_get_wrap#} (toSpinButton sb) +spinButtonGetWrap :: SpinButtonClass self => self + -> IO Bool -- ^ returns @True@ if the spin button wraps around +spinButtonGetWrap self = + liftM toBool $ + {# call spin_button_get_wrap #} + (toSpinButton self) -- | Sets the policy as to whether values are corrected to the nearest step -- increment when a spin button is activated after providing an invalid value. -- -spinButtonSetSnapToTicks :: SpinButtonClass sb => sb -> Bool -> IO () -spinButtonSetSnapToTicks sb snapToTicks = - {#call spin_button_set_snap_to_ticks#} (toSpinButton sb) - (fromBool snapToTicks) +spinButtonSetSnapToTicks :: SpinButtonClass self => self + -> Bool -- ^ @snapToTicks@ - a flag indicating if invalid values should be + -- corrected. + -> IO () +spinButtonSetSnapToTicks self snapToTicks = + {# call spin_button_set_snap_to_ticks #} + (toSpinButton self) + (fromBool snapToTicks) --- | Returns whether the values are corrected to the nearest step. +-- | Returns whether the values are corrected to the nearest step. See +-- 'spinButtonSetSnapToTicks'. -- -spinButtonGetSnapToTicks :: SpinButtonClass sb => sb -> IO Bool -spinButtonGetSnapToTicks sb = liftM toBool $ - {#call unsafe spin_button_get_snap_to_ticks#} (toSpinButton sb) +spinButtonGetSnapToTicks :: SpinButtonClass self => self + -> IO Bool -- ^ returns @True@ if values are snapped to the nearest step. +spinButtonGetSnapToTicks self = + liftM toBool $ + {# call unsafe spin_button_get_snap_to_ticks #} + (toSpinButton self) --- | Force an update of the SpinButton. +-- | Manually force an update of the spin button. -- -spinButtonUpdate :: SpinButtonClass sb => sb -> IO () -spinButtonUpdate sb = {#call spin_button_update#} (toSpinButton sb) +spinButtonUpdate :: SpinButtonClass self => self -> IO () +spinButtonUpdate self = + {# call spin_button_update #} + (toSpinButton self) -------------------- -- Properties Index: EntryCompletion.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Entry/EntryCompletion.chs.pp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- EntryCompletion.chs.pp 13 Mar 2005 19:34:33 -0000 1.6 +++ EntryCompletion.chs.pp 15 Mar 2005 19:59:12 -0000 1.7 @@ -26,10 +26,10 @@ -- -- Completion functionality for the 'Entry' widget. -- --- * Available since Gtk version 2.4 +-- * Module available since Gtk+ version 2.4 -- module Graphics.UI.Gtk.Entry.EntryCompletion ( --- * Description +-- * Detail -- -- | 'EntryCompletion' is an auxiliary object to be used in conjunction with -- 'Entry' to provide the completion functionality. It implements the @@ -90,9 +90,7 @@ -- * Properties entryCompletionMinimumKeyLength -) where - -#if GTK_CHECK_VERSION(2,4,0) + ) where import Monad (liftM) import Data.IORef (newIORef, readIORef, writeIORef) @@ -108,9 +106,12 @@ {# context lib="gtk" prefix="gtk" #} +#if GTK_CHECK_VERSION(2,4,0) -------------------- -- Constructors +-- | Creates a new 'EntryCompletion' object. +-- entryCompletionNew :: IO EntryCompletion entryCompletionNew = makeNewGObject mkEntryCompletion $ liftM castPtr $ @@ -119,60 +120,52 @@ -------------------- -- Methods -entryCompletionGetEntry :: EntryCompletion -> IO (Maybe Entry) -entryCompletionGetEntry ec = do - entryPtr <- {# call gtk_entry_completion_get_entry #} ec - if entryPtr == nullPtr - then return Nothing - else liftM Just $ makeNewObject mkEntry $ return (castPtr entryPtr) +-- | Gets the entry @completion@ has been attached to. +-- +entryCompletionGetEntry :: EntryCompletion + -> IO (Maybe Widget) -- ^ returns the entry @completion@ has been attached + -- to. +entryCompletionGetEntry self = + maybeNull (makeNewObject mkWidget) $ + {# call gtk_entry_completion_get_entry #} + self -entryCompletionSetModel :: EntryCompletion -> TreeModel -> IO () -entryCompletionSetModel ec tm = - {# call gtk_entry_completion_set_model #} ec tm +-- | Sets the model for a 'EntryCompletion'. If @completion@ already has a +-- model set, it will remove it before setting the new model. If model is +-- @Nothing@, then it will unset the model. +-- +entryCompletionSetModel :: TreeModelClass model => EntryCompletion + -> Maybe model -- ^ @model@ - The 'TreeModel'. + -> IO () +entryCompletionSetModel self model = + {# call gtk_entry_completion_set_model #} + self + (maybe (TreeModel nullForeignPtr) toTreeModel model) -entryCompletionGetModel :: EntryCompletion -> IO TreeModel -entryCompletionGetModel ec = - makeNewGObject mkTreeModel $ - {# call gtk_entry_completion_get_model #} ec +-- | Returns the model the 'EntryCompletion' is using as data source. Returns +-- @Nothing@ if the model is unset. +-- +entryCompletionGetModel :: EntryCompletion + -> IO (Maybe TreeModel) -- ^ returns A 'TreeModel', or @Nothing@ if none is + -- currently being used. +entryCompletionGetModel self = + maybeNull (makeNewGObject mkTreeModel) $ + {# call gtk_entry_completion_get_model #} + self +-- | Sets the match function for @completion@ to be @func@. The match function +-- is used to determine if a row should or should not be in the completion +-- list. +-- entryCompletionSetMatchFunc :: EntryCompletion -> (String -> TreeIter -> IO ()) -> IO () -entryCompletionSetMatchFunc ec handler = - connect_GtkEntryCompletionMatchFunc ec handler - -entryCompletionSetMinimumKeyLength :: EntryCompletion -> Int -> IO () -entryCompletionSetMinimumKeyLength ec minLength = - {# call gtk_entry_completion_set_minimum_key_length #} ec - (fromIntegral minLength) - -entryCompletionGetMinimumKeyLength :: EntryCompletion -> IO Int -entryCompletionGetMinimumKeyLength ec = - liftM fromIntegral $ - {# call gtk_entry_completion_get_minimum_key_length #} ec - -entryCompletionComplete :: EntryCompletion -> IO () -entryCompletionComplete ec = - {# call gtk_entry_completion_complete #} ec - -entryCompletionInsertActionText :: EntryCompletion -> Int -> String -> IO () -entryCompletionInsertActionText ec index text = - withUTFString text $ \strPtr -> - {# call gtk_entry_completion_insert_action_text #} ec - (fromIntegral index) strPtr - -entryCompletionInsertActionMarkup :: EntryCompletion -> Int -> String -> IO () -entryCompletionInsertActionMarkup ec index markup = - withUTFString markup $ \strPtr -> - {# call gtk_entry_completion_insert_action_markup #} ec - (fromIntegral index) strPtr - -entryCompletionDeleteAction :: EntryCompletion -> Int -> IO () -entryCompletionDeleteAction ec index = - {# call gtk_entry_completion_delete_action #} ec (fromIntegral index) - -entryCompletionSetTextColumn :: EntryCompletion -> Int -> IO () -entryCompletionSetTextColumn ec column = - {# call gtk_entry_completion_set_text_column #} ec (fromIntegral column) - +entryCompletionSetMatchFunc ec handler = do + hPtr <- mkHandler_GtkEntryCompletionMatchFunc + (\_ keyPtr iterPtr _ -> do key <- peekUTFString keyPtr + iter <- createTreeIter iterPtr + handler key iter) + dPtr <- mkFunPtrDestructor hPtr + {# call gtk_entry_completion_set_match_func #} ec + (castFunPtr hPtr) nullPtr dPtr ------------------------------------------------- -- Callback stuff for entryCompletionSetMatchFunc @@ -189,17 +182,93 @@ GtkEntryCompletionMatchFunc -> IO (FunPtr GtkEntryCompletionMatchFunc) -connect_GtkEntryCompletionMatchFunc :: EntryCompletion -> - (String -> TreeIter -> IO ()) -> - IO () -connect_GtkEntryCompletionMatchFunc ec user = do - hPtr <- mkHandler_GtkEntryCompletionMatchFunc - (\_ keyPtr iterPtr _ -> do key <- peekUTFString keyPtr - iter <- createTreeIter iterPtr - user key iter) - dPtr <- mkFunPtrDestructor hPtr - {# call gtk_entry_completion_set_match_func #} ec - (castFunPtr hPtr) nullPtr dPtr +-- | Requires the length of the search key for @completion@ to be at least +-- @length@. This is useful for long lists, where completing using a small key +-- takes a lot of time and will come up with meaningless results anyway (ie, a +-- too large dataset). +-- +entryCompletionSetMinimumKeyLength :: EntryCompletion + -> Int -- ^ @length@ - The minimum length of the key in order to + -- start completing. + -> IO () +entryCompletionSetMinimumKeyLength self length = + {# call gtk_entry_completion_set_minimum_key_length #} + self + (fromIntegral length) + +-- | Returns the minimum key length as set for @completion@. +-- +entryCompletionGetMinimumKeyLength :: EntryCompletion + -> IO Int -- ^ returns The currently used minimum key length. +entryCompletionGetMinimumKeyLength self = + liftM fromIntegral $ + {# call gtk_entry_completion_get_minimum_key_length #} + self + +-- | Requests a completion operation, or in other words a refiltering of the +-- current list with completions, using the current key. The completion list +-- view will be updated accordingly. +-- +entryCompletionComplete :: EntryCompletion -> IO () +entryCompletionComplete self = + {# call gtk_entry_completion_complete #} + self + +-- | Inserts an action in @completion@'s action item list at position @index@ +-- with text @text@. If you want the action item to have markup, use +-- 'entryCompletionInsertActionMarkup'. +-- +entryCompletionInsertActionText :: EntryCompletion + -> Int -- ^ @index@ - The index of the item to insert. + -> String -- ^ @text@ - Text of the item to insert. + -> IO () +entryCompletionInsertActionText self index text = + withUTFString text $ \textPtr -> + {# call gtk_entry_completion_insert_action_text #} + self + (fromIntegral index) + textPtr + +-- | Inserts an action in @completion@'s action item list at position @index@ +-- with markup @markup@. +-- +entryCompletionInsertActionMarkup :: EntryCompletion + -> Int -- ^ @index@ - The index of the item to insert. + -> String -- ^ @markup@ - Markup of the item to insert. + -> IO () +entryCompletionInsertActionMarkup self index markup = + withUTFString markup $ \markupPtr -> + {# call gtk_entry_completion_insert_action_markup #} + self + (fromIntegral index) + markupPtr + +-- | Deletes the action at @index@ from @completion@'s action list. +-- +entryCompletionDeleteAction :: EntryCompletion + -> Int -- ^ @index@ - The index of the item to Delete. + -> IO () +entryCompletionDeleteAction self index = + {# call gtk_entry_completion_delete_action #} + self + (fromIntegral index) + +-- | Convenience function for setting up the most used case of this code: a +-- completion list with just strings. This function will set up @completion@ to +-- have a list displaying all (and just) strings in the completion list, and to +-- get those strings from @column@ in the model of @completion@. +-- +-- This functions creates and adds a 'CellRendererText' for the selected +-- column. +-- +entryCompletionSetTextColumn :: EntryCompletion + -> Int -- ^ @column@ - The column in the model of @completion@ to + -- get strings from. + -> IO () +entryCompletionSetTextColumn self column = + {# call gtk_entry_completion_set_text_column #} + self + (fromIntegral column) -------------------- -- Properties Index: HScale.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Entry/HScale.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- HScale.chs 25 Feb 2005 01:11:33 -0000 1.3 +++ HScale.chs 15 Mar 2005 19:59:12 -0000 1.4 @@ -24,10 +24,10 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- A horizontal slider widget for selecting a value from a range. +-- A horizontal slider widget for selecting a value from a range -- module Graphics.UI.Gtk.Entry.HScale ( --- * Description +-- * Detail -- -- | The 'HScale' widget is used to allow the user to select a value using a -- horizontal slider. To create one, use 'hScaleNewWithRange'. @@ -68,21 +68,31 @@ -------------------- -- Constructors --- | Create a new HScale widget. +-- | Creates a new 'HScale'. -- -hScaleNew :: Adjustment -> IO HScale -hScaleNew adj = makeNewObject mkHScale $ liftM castPtr $ - {#call unsafe hscale_new#} adj +hScaleNew :: + Adjustment -- ^ @adjustment@ - the 'Adjustment' which sets the range of + -- the scale. + -> IO HScale +hScaleNew adjustment = + makeNewObject mkHScale $ liftM castPtr $ + {# call unsafe hscale_new #} + adjustment --- | Create a new HScale widget with @min@, @max@ and @step@ values rather than --- an "Adjustment" object. +-- | Creates a new horizontal scale widget that lets the user input a number +-- between @min@ and @max@ (including @min@ and @max@) with the increment +-- @step@. @step@ must be nonzero; it's the distance the slider moves when +-- using the arrow keys to adjust the scale value. -- -hScaleNewWithRange :: Double -- ^ Minimum value - -> Double -- ^ Maximum value - -> Double -- ^ Step increment (tick size) used with keyboard - -- shortcuts. Must be nonzero. - -> IO HScale +hScaleNewWithRange :: + Double -- ^ @min@ - minimum value + -> Double -- ^ @max@ - maximum value + -> Double -- ^ @step@ - step increment (tick size) used with keyboard + -- shortcuts + -> IO HScale hScaleNewWithRange min max step = makeNewObject mkHScale $ liftM castPtr $ - {#call unsafe hscale_new_with_range#} (realToFrac min) (realToFrac max) + {# call unsafe hscale_new_with_range #} + (realToFrac min) + (realToFrac max) (realToFrac step) Index: Entry.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Entry/Entry.chs.pp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Entry.chs.pp 13 Mar 2005 19:34:33 -0000 1.5 +++ Entry.chs.pp 15 Mar 2005 19:59:12 -0000 1.6 @@ -29,10 +29,10 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- A single line text entry field. +-- A single line text entry field -- module Graphics.UI.Gtk.Entry.Entry ( --- * Description +-- * Detail -- -- | The 'Entry' widget is a single line text entry widget. A fairly large set -- of key bindings are supported by default. If the entered text is longer than @@ -129,160 +129,260 @@ -------------------- -- Constructors --- | Create a new 'Entry' widget. +-- | Creates a new 'Entry' widget. -- entryNew :: IO Entry -entryNew = makeNewObject mkEntry $ liftM castPtr $ {#call unsafe entry_new#} +entryNew = + makeNewObject mkEntry $ liftM castPtr $ + {# call unsafe entry_new #} -------------------- -- Methods --- | Set the text of the 'Entry' widget. +-- | Sets the text in the widget to the given value, replacing the current +-- contents. -- -entrySetText :: EntryClass ec => ec -> String -> IO () -entrySetText ec str = withUTFString str $ {#call entry_set_text#} (toEntry ec) +entrySetText :: EntryClass self => self -> String -> IO () +entrySetText self text = + withUTFString text $ \textPtr -> + {# call entry_set_text #} + (toEntry self) + textPtr --- | Get the text of the 'Entry' widget. +-- | Retrieves the contents of the entry widget. See also 'editableGetChars'. -- -entryGetText :: EntryClass ec => ec -> IO String -entryGetText ec = {#call entry_get_text#} (toEntry ec) >>= peekUTFString +entryGetText :: EntryClass self => self -> IO String +entryGetText self = + {# call entry_get_text #} + (toEntry self) + >>= peekUTFString #ifndef DISABLE_DEPRECATED --- | Append to the text of the 'Entry' widget. +-- | Appends the given text to the contents of the widget. -- -entryAppendText :: EntryClass ec => ec -> String -> IO () -entryAppendText ec str = - withUTFString str $ {#call entry_append_text#} (toEntry ec) +-- * Warning: this function is deprecated and should not be used in +-- newly-written code. +-- +entryAppendText :: EntryClass self => self -> String -> IO () +entryAppendText self text = + withUTFString text $ \textPtr -> + {# call entry_append_text #} + (toEntry self) + textPtr --- | Prepend the text of the 'Entry' widget. +-- | Prepends the given text to the contents of the widget. -- -entryPrependText :: EntryClass ec => ec -> String -> IO () -entryPrependText ec str = - withUTFString str $ {#call entry_prepend_text#} (toEntry ec) +-- * Warning: this function is deprecated and should not be used in +-- newly-written code. +-- +entryPrependText :: EntryClass self => self -> String -> IO () +entryPrependText self text = + withUTFString text $ \textPtr -> + {# call entry_prepend_text #} + (toEntry self) + textPtr #endif --- | Set whether to use password mode (display stars instead of the text). +-- | Sets whether the contents of the entry are visible or not. When +-- visibility is set to @False@, characters are displayed as the invisible +-- char, and will also appear that way when the text in the entry widget is +-- copied elsewhere. -- --- * The replacement character can be changed with 'entrySetInvisibleChar'. +-- The default invisible char is the asterisk \'*\', but it can be changed +-- with 'entrySetInvisibleChar'. -- -entrySetVisibility :: EntryClass ec => ec -> Bool -> IO () -entrySetVisibility ec visible = - {#call entry_set_visibility#} (toEntry ec) (fromBool visible) +entrySetVisibility :: EntryClass self => self + -> Bool -- ^ @visible@ - @True@ if the contents of the entry are displayed + -- as plaintext. + -> IO () +entrySetVisibility self visible = + {# call entry_set_visibility #} + (toEntry self) + (fromBool visible) --- | Get whether widget is in password mode. +-- | Retrieves whether the text in @entry@ is visible. See +-- 'entrySetVisibility'. -- -entryGetVisibility :: EntryClass ec => ec -> IO Bool -entryGetVisibility ec = - liftM toBool $ {#call entry_get_visibility#} (toEntry ec) +entryGetVisibility :: EntryClass self => self + -> IO Bool -- ^ returns @True@ if the text is currently visible +entryGetVisibility self = + liftM toBool $ + {# call entry_get_visibility #} + (toEntry self) --- | Set the replacement character for invisible text. +-- | Sets the character to use in place of the actual text when +-- 'entrySetVisibility' has been called to set text visibility to @False@. i.e. +-- this is the character used in \"password mode\" to show the user how many +-- characters have been typed. The default invisible char is an asterisk +-- (\'*\'). If you set the invisible char to @\'\\0\'@, then the user will get +-- no feedback at all; there will be no text on the screen as they type. -- -entrySetInvisibleChar :: EntryClass ec => ec -> Char -> IO () -entrySetInvisibleChar ec ch = - {#call unsafe entry_set_invisible_char#} (toEntry ec) ((fromIntegral.ord) ch) +entrySetInvisibleChar :: EntryClass self => self -> Char -> IO () +entrySetInvisibleChar self ch = + {# call unsafe entry_set_invisible_char #} + (toEntry self) + ((fromIntegral . ord) ch) --- | Get the current replacement character for invisible text, --- or 0 if not in password mode. +-- | Retrieves the character displayed in place of the real characters for +-- entries with visisbility set to false. See 'entrySetInvisibleChar'. -- -entryGetInvisibleChar :: EntryClass ec => ec -> IO Char -entryGetInvisibleChar ec = liftM (chr.fromIntegral) $ - {#call unsafe entry_get_invisible_char#} (toEntry ec) +entryGetInvisibleChar :: EntryClass self => self + -> IO Char -- ^ returns the current invisible char, or @\'\\0\'@, if the + -- entry does not show invisible text at all. +entryGetInvisibleChar self = + liftM (chr . fromIntegral) $ + {# call unsafe entry_get_invisible_char #} + (toEntry self) --- | Sets a maximum length the text may grow to. --- --- * A negative number resets the restriction. +-- | Sets the maximum allowed length of the contents of the widget. If the +-- current contents are longer than the given length, then they will be +-- truncated to fit. -- -entrySetMaxLength :: EntryClass ec => ec -> Int -> IO () -entrySetMaxLength ec max = - {#call entry_set_max_length#} (toEntry ec) (fromIntegral max) +entrySetMaxLength :: EntryClass self => self + -> Int -- ^ @max@ - the maximum length of the entry, or 0 for no maximum. + -- (other than the maximum length of entries.) The value passed in + -- will be clamped to the range 0-65536. + -> IO () +entrySetMaxLength self max = + {# call entry_set_max_length #} + (toEntry self) + (fromIntegral max) --- | Gets a maximum length the text is allowed to grow to. +-- | Retrieves the maximum allowed length of the text in @entry@. See +-- 'entrySetMaxLength'. -- -entryGetMaxLength :: EntryClass ec => ec -> IO Int -entryGetMaxLength ec = - liftM fromIntegral $ {#call unsafe entry_get_max_length#} (toEntry ec) +entryGetMaxLength :: EntryClass self => self + -> IO Int -- ^ returns the maximum allowed number of characters in 'Entry', + -- or 0 if there is no maximum. +entryGetMaxLength self = + liftM fromIntegral $ + {# call unsafe entry_get_max_length #} + (toEntry self) -- | Query whether pressing return will activate the default widget. -- -entryGetActivatesDefault :: EntryClass ec => ec -> IO Bool -entryGetActivatesDefault ec = liftM toBool $ - {#call unsafe entry_get_activates_default#} (toEntry ec) +entryGetActivatesDefault :: EntryClass self => self + -> IO Bool -- ^ returns @True@ if the entry will activate the default widget +entryGetActivatesDefault self = + liftM toBool $ + {# call unsafe entry_get_activates_default #} + (toEntry self) --- | Specify if pressing return will activate --- the default widget. +-- | If @setting@ is @True@, pressing Enter in the @entry@ will activate the +-- default widget for the window containing the entry. This usually means that +-- the dialog box containing the entry will be closed, since the default widget +-- is usually one of the dialog buttons. -- --- * This setting is useful in 'Dialog' boxes where enter should press --- the default button. +-- (For experts: if @setting@ is @True@, the entry calls +-- 'windowActivateDefault' on the window containing the entry, in the default +-- handler for the \"activate\" signal.) -- -entrySetActivatesDefault :: EntryClass ec => ec -> Bool -> IO () -entrySetActivatesDefault ec setting = {#call entry_set_activates_default#} - (toEntry ec) (fromBool setting) +-- This setting is useful in 'Dialog' boxes where enter should press the +-- default button. +-- +entrySetActivatesDefault :: EntryClass self => self + -> Bool -- ^ @setting@ - @True@ to activate window's default widget on Enter + -- keypress + -> IO () +entrySetActivatesDefault self setting = + {# call entry_set_activates_default #} + (toEntry self) + (fromBool setting) -- | Query if the text 'Entry' is displayed with a frame around it. -- -entryGetHasFrame :: EntryClass ec => ec -> IO Bool -entryGetHasFrame ec = liftM toBool $ - {#call unsafe entry_get_has_frame#} (toEntry ec) +entryGetHasFrame :: EntryClass self => self + -> IO Bool -- ^ returns whether the entry has a beveled frame +entryGetHasFrame self = + liftM toBool $ + {# call unsafe entry_get_has_frame #} + (toEntry self) --- | Specifies whehter the 'Entry' should be in an etched-in frame. +-- | Sets whether the entry has a beveled frame around it. -- -entrySetHasFrame :: EntryClass ec => ec -> Bool -> IO () -entrySetHasFrame ec setting = {#call entry_set_has_frame#} - (toEntry ec) (fromBool setting) +entrySetHasFrame :: EntryClass self => self -> Bool -> IO () +entrySetHasFrame self setting = + {# call entry_set_has_frame #} + (toEntry self) + (fromBool setting) -- | Retrieve the number of characters the widget should ask for. -- -entryGetWidthChars :: EntryClass ec => ec -> IO Int -entryGetWidthChars ec = liftM fromIntegral $ - {#call unsafe entry_get_width_chars#} (toEntry ec) +entryGetWidthChars :: EntryClass self => self + -> IO Int -- ^ returns number of chars to request space for, or negative if + -- unset +entryGetWidthChars self = + liftM fromIntegral $ + {# call unsafe entry_get_width_chars #} + (toEntry self) --- | Specifies how large the 'Entry' should be in characters. +-- | Changes the size request of the entry to be about the right size for +-- @nChars@ characters. Note that it changes the size /request/, the size can +-- still be affected by how you pack the widget into containers. If @nChars@ is +-- -1, the size reverts to the default entry size. -- --- * This setting is only considered when the widget formulates its size --- request. Make sure that it is not mapped (shown) before you change this --- value. +-- This setting is only considered when the widget formulates its size +-- request. Make sure that it is not mapped (shown) before you change this +-- value. -- -entrySetWidthChars :: EntryClass ec => ec -> Int -> IO () -entrySetWidthChars ec setting = {#call entry_set_width_chars#} - (toEntry ec) (fromIntegral setting) +entrySetWidthChars :: EntryClass self => self + -> Int -- ^ @nChars@ - width in chars + -> IO () +entrySetWidthChars self nChars = + {# call entry_set_width_chars #} + (toEntry self) + (fromIntegral nChars) #if GTK_CHECK_VERSION(2,4,0) -- | Sets the alignment for the contents of the entry. This controls the -- horizontal positioning of the contents when the displayed text is shorter -- than the width of the entry. -- --- * Since gtk 2.4 +-- * Available since Gtk version 2.4 -- -entrySetAlignment :: EntryClass ec => ec -> Float -> IO () -entrySetAlignment ec xalign = - {#call entry_set_alignment#} (toEntry ec) (realToFrac xalign) +entrySetAlignment :: EntryClass self => self + -> Float -- ^ @xalign@ - The horizontal alignment, from 0 (left) to 1 + -- (right). Reversed for RTL layouts + -> IO () +entrySetAlignment self xalign = + {# call entry_set_alignment #} + (toEntry self) + (realToFrac xalign) -- | Gets the value set by 'entrySetAlignment'. -- --- * Since gtk 2.4 +-- * Available since Gtk version 2.4 -- -entryGetAlignment :: EntryClass ec => ec -> IO Float -entryGetAlignment ec = - liftM realToFrac $ {#call unsafe entry_get_alignment#} (toEntry ec) +entryGetAlignment :: EntryClass self => self + -> IO Float -- ^ returns the alignment +entryGetAlignment self = + liftM realToFrac $ + {# call unsafe entry_get_alignment #} + (toEntry self) -- | Sets the auxiliary completion object to use with the entry. All further -- configuration of the completion mechanism is done on completion using the --- "EntryCompletion" API. +-- 'EntryCompletion' API. -- --- * Since gtk 2.4 +-- * Available since Gtk version 2.4 -- -entrySetCompletion :: EntryClass ec => ec -> EntryCompletion -> IO () -entrySetCompletion ec completion = {#call gtk_entry_set_completion#} - (toEntry ec) completion +entrySetCompletion :: EntryClass self => self -> EntryCompletion -> IO () +entrySetCompletion self completion = + {# call gtk_entry_set_completion #} + (toEntry self) + completion -- | Returns the auxiliary completion object currently in use by the entry. -- --- * Since gtk 2.4 +-- * Available since Gtk version 2.4 -- -entryGetCompletion :: EntryClass ec => ec -> IO EntryCompletion -entryGetCompletion ec = +entryGetCompletion :: EntryClass self => self + -> IO EntryCompletion -- ^ returns The auxiliary completion object currently + -- in use by @entry@. +entryGetCompletion self = makeNewGObject mkEntryCompletion $ - {#call gtk_entry_get_completion#} (toEntry ec) + {# call gtk_entry_get_completion #} + (toEntry self) #endif -------------------- |
From: Duncan C. <dun...@us...> - 2005-03-15 19:59:30
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Display In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5160/gtk/Graphics/UI/Gtk/Display Modified Files: AccelLabel.chs Image.chs.pp Label.chs ProgressBar.chs Statusbar.chs Log Message: Documentation changes and code formatting changes. Index: Image.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Display/Image.chs.pp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Image.chs.pp 25 Feb 2005 01:11:32 -0000 1.4 +++ Image.chs.pp 15 Mar 2005 19:59:09 -0000 1.5 @@ -126,42 +126,73 @@ -------------------- -- Constructors --- | Create an image by loading a file. +-- | Creates a new 'Image' displaying the file @filename@. If the file isn't +-- found or can't be loaded, the resulting 'Image' will display a \"broken +-- image\" icon. +-- +-- If the file contains an animation, the image will contain an animation. +-- +-- If you need to detect failures to load the file, use 'pixbufNewFromFile' +-- to load the file yourself, then create the 'Image' from the pixbuf. (Or for +-- animations, use 'pixbufAnimationNewFromFile'). +-- +-- The storage type ('imageGetStorageType') of the returned image is not +-- defined, it will be whatever is appropriate for displaying the file. -- imageNewFromFile :: FilePath -> IO Image -imageNewFromFile path = makeNewObject mkImage $ liftM castPtr $ +imageNewFromFile filename = + makeNewObject mkImage $ liftM castPtr $ + withUTFString filename $ \filenamePtr -> #if defined (WIN32) && GTK_CHECK_VERSION(2,6,0) - withUTFString path {#call unsafe image_new_from_file_utf8#} + {# call unsafe gtk_image_new_from_file_utf8 #} #else - withUTFString path {#call unsafe image_new_from_file#} + {# call unsafe gtk_image_new_from_file #} #endif + filenamePtr --- | Create an 'Image' from a --- 'Pixbuf'. +-- | Creates a new 'Image' displaying a 'Pixbuf'. +-- +-- Note that this function just creates an 'Image' from the pixbuf. The +-- 'Image' created will not react to state changes. Should you want that, you +-- should use 'imageNewFromIconSet'. -- imageNewFromPixbuf :: Pixbuf -> IO Image -imageNewFromPixbuf pbuf = makeNewObject mkImage $ liftM castPtr $ - {#call unsafe image_new_from_pixbuf#} pbuf +imageNewFromPixbuf pixbuf = + makeNewObject mkImage $ liftM castPtr $ + {# call unsafe image_new_from_pixbuf #} + pixbuf --- | Create a set of images by specifying a stock --- object. +-- | Creates a 'Image' displaying a stock icon. If the stock icon name isn't +-- known, a \"broken image\" icon will be displayed instead. -- -imageNewFromStock :: String -> IconSize -> IO Image -imageNewFromStock stock ic = withUTFString stock $ \strPtr -> - makeNewObject mkImage $ liftM castPtr $ {#call unsafe image_new_from_stock#} - strPtr (fromIntegral ic) +imageNewFromStock :: + String -- ^ @stockId@ - a stock icon name + -> IconSize -- ^ @size@ - a stock icon size + -> IO Image +imageNewFromStock stockId size = + makeNewObject mkImage $ liftM castPtr $ + withUTFString stockId $ \stockIdPtr -> + {# call unsafe image_new_from_stock #} + stockIdPtr + (fromIntegral size) -------------------- -- Methods --- | Extract the Pixbuf from the 'Image'. +-- | Gets the 'Pixbuf' being displayed by the 'Image'. The storage type of the +-- image must be 'ImageEmpty' or 'ImagePixbuf' (see 'imageGetStorageType'). -- imageGetPixbuf :: Image -> IO Pixbuf -imageGetPixbuf img = makeNewGObject mkPixbuf $ liftM castPtr $ +imageGetPixbuf self = + makeNewGObject mkPixbuf $ liftM castPtr $ throwIfNull "Image.imageGetPixbuf: The image contains no Pixbuf object." $ - {#call unsafe image_get_pixbuf#} img + {# call unsafe image_get_pixbuf #} + self -- | Overwrite the current content of the 'Image' with a new 'Pixbuf'. -- imageSetFromPixbuf :: Image -> Pixbuf -> IO () -imageSetFromPixbuf img pb = {#call unsafe gtk_image_set_from_pixbuf#} img pb +imageSetFromPixbuf self pixbuf = + {# call unsafe gtk_image_set_from_pixbuf #} + self + pixbuf Index: ProgressBar.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Display/ProgressBar.chs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ProgressBar.chs 13 Mar 2005 19:34:32 -0000 1.5 +++ ProgressBar.chs 15 Mar 2005 19:59:10 -0000 1.6 @@ -24,10 +24,10 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- A widget which indicates progress visually. +-- A widget which indicates progress visually -- module Graphics.UI.Gtk.Display.ProgressBar ( --- * Description +-- * Detail -- -- | The 'ProgressBar' is typically used to display the progress of a long -- running operation. It provides a visual clue that processing is underway. @@ -106,89 +106,102 @@ -- | Creates a new 'ProgressBar'. -- progressBarNew :: IO ProgressBar -progressBarNew = makeNewObject mkProgressBar $ liftM castPtr $ - {#call unsafe progress_bar_new#} +progressBarNew = + makeNewObject mkProgressBar $ liftM castPtr $ + {# call unsafe progress_bar_new #} -------------------- -- Methods --- | Indicates that some progress is made, but you --- don't know how much. Causes the progress bar to enter \`activity mode', --- where a block bounces back and forth. Each call to --- 'progressBarPulse' causes the block to move on by a little bit --- (the amount of movement per pulse is determined by +-- | Indicates that some progress is made, but you don't know how much. Causes +-- the progress bar to enter \"activity mode\", where a block bounces back and +-- forth. Each call to 'progressBarPulse' causes the block to move by a little +-- bit (the amount of movement per pulse is determined by -- 'progressBarSetPulseStep'). -- -progressBarPulse :: ProgressBarClass pb => pb -> IO () -progressBarPulse pb = {#call unsafe progress_bar_pulse#} (toProgressBar pb) +progressBarPulse :: ProgressBarClass self => self -> IO () +progressBarPulse self = + {# call unsafe progress_bar_pulse #} + (toProgressBar self) --- | Causes the given @text@ to appear --- superimposed on the progress bar. +-- | Causes the given @text@ to appear superimposed on the progress bar. -- -progressBarSetText :: ProgressBarClass pb => pb -> String -> IO () -progressBarSetText pb text = withUTFString text $ - {#call unsafe progress_bar_set_text#} (toProgressBar pb) +progressBarSetText :: ProgressBarClass self => self -> String -> IO () +progressBarSetText self text = + withUTFString text $ \textPtr -> + {# call unsafe progress_bar_set_text #} + (toProgressBar self) + textPtr --- | Causes the progress bar to \`fill in' the --- given fraction of the bar. The fraction should be between 0.0 and 1.0, --- inclusive. +-- | Causes the progress bar to \"fill in\" the given fraction of the bar. The +-- fraction should be between 0.0 and 1.0, inclusive. -- -progressBarSetFraction :: ProgressBarClass pb => pb -> Double -> IO () -progressBarSetFraction pb fraction = {#call unsafe progress_bar_set_fraction#} - (toProgressBar pb) (realToFrac fraction) +progressBarSetFraction :: ProgressBarClass self => self + -> Double -- ^ @fraction@ - fraction of the task that's been completed + -> IO () +progressBarSetFraction self fraction = + {# call unsafe progress_bar_set_fraction #} + (toProgressBar self) + (realToFrac fraction) --- | Sets the fraction of total progress bar --- length to move the bouncing block for each call to progressBarPulse. --- --- * The @fraction@ parameter must be between 0.0 and 1.0. +-- | Sets the fraction of total progress bar length to move the bouncing block +-- for each call to 'progressBarPulse'. -- -progressBarSetPulseStep :: ProgressBarClass pb => pb -> Double -> IO () -progressBarSetPulseStep pb fraction = - {#call unsafe progress_bar_set_pulse_step#} (toProgressBar pb) - (realToFrac fraction) +progressBarSetPulseStep :: ProgressBarClass self => self + -> Double -- ^ @fraction@ - fraction between 0.0 and 1.0 + -> IO () +progressBarSetPulseStep self fraction = + {# call unsafe progress_bar_set_pulse_step #} + (toProgressBar self) + (realToFrac fraction) --- | Returns the current fraction of the task --- that has been completed. +-- | Returns the current fraction of the task that's been completed. -- -progressBarGetFraction :: ProgressBarClass pb => pb -> IO Double -progressBarGetFraction pb = liftM realToFrac $ - {#call unsafe progress_bar_get_fraction#} (toProgressBar pb) +progressBarGetFraction :: ProgressBarClass self => self + -> IO Double -- ^ returns a fraction from 0.0 to 1.0 +progressBarGetFraction self = + liftM realToFrac $ + {# call unsafe progress_bar_get_fraction #} + (toProgressBar self) --- | Returns the current pulseStep of the task --- that has been completed. +-- | Retrieves the pulse step set with 'progressBarSetPulseStep' -- -progressBarGetPulseStep :: ProgressBarClass pb => pb -> IO Double -progressBarGetPulseStep pb = liftM realToFrac $ - {#call unsafe progress_bar_get_pulse_step#} (toProgressBar pb) - +progressBarGetPulseStep :: ProgressBarClass self => self + -> IO Double -- ^ returns a fraction from 0.0 to 1.0 +progressBarGetPulseStep self = + liftM realToFrac $ + {# call unsafe progress_bar_get_pulse_step #} + (toProgressBar self) --- | Retrieve the text displayed superimposed on the --- ProgressBar. --- --- * Returns Nothing if no text was set. +-- | Retrieves the text displayed superimposed on the progress bar, if any, +-- otherwise @Nothing@. -- -progressBarGetText :: ProgressBarClass pb => pb -> IO (Maybe String) -progressBarGetText pb = do - strPtr <- {#call unsafe progress_bar_get_text#} (toProgressBar pb) - if strPtr==nullPtr then return Nothing else liftM Just $ peekUTFString strPtr +progressBarGetText :: ProgressBarClass self => self + -> IO (Maybe String) -- ^ returns text, or @Nothing@ +progressBarGetText self = + {# call unsafe progress_bar_get_text #} + (toProgressBar self) + >>= maybePeek peekUTFString --- | Causes the progress bar to switch to a --- different orientation (left-to-right, right-to-left, top-to-bottom, or --- bottom-to-top). +-- | Causes the progress bar to switch to a different orientation +-- (left-to-right, right-to-left, top-to-bottom, or bottom-to-top). -- -progressBarSetOrientation :: ProgressBarClass pb => pb -> - ProgressBarOrientation -> IO () -progressBarSetOrientation pb orientation = - {#call progress_bar_set_orientation#} (toProgressBar pb) - ((fromIntegral.fromEnum) orientation) +progressBarSetOrientation :: ProgressBarClass self => self + -> ProgressBarOrientation + -> IO () +progressBarSetOrientation self orientation = + {# call progress_bar_set_orientation #} + (toProgressBar self) + ((fromIntegral . fromEnum) orientation) --- | Retrieve the current ProgressBar --- orientation. +-- | Retrieves the current progress bar orientation. -- -progressBarGetOrientation :: ProgressBarClass pb => pb -> - IO ProgressBarOrientation -progressBarGetOrientation pb = liftM (toEnum.fromIntegral) $ - {#call unsafe progress_bar_get_orientation#} (toProgressBar pb) +progressBarGetOrientation :: ProgressBarClass self => self + -> IO ProgressBarOrientation +progressBarGetOrientation self = + liftM (toEnum . fromIntegral) $ + {# call unsafe progress_bar_get_orientation #} + (toProgressBar self) -------------------- -- Properties Index: Statusbar.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Display/Statusbar.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Statusbar.chs 25 Feb 2005 01:11:32 -0000 1.3 +++ Statusbar.chs 15 Mar 2005 19:59:10 -0000 1.4 @@ -1,5 +1,5 @@ -- -*-haskell-*- --- GIMP Toolkit (GTK) Widget StatusBar +-- GIMP Toolkit (GTK) Widget Statusbar -- -- Author : Axel Simon -- @@ -24,10 +24,10 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- Report messages of minor importance to the user. +-- Report messages of minor importance to the user -- module Graphics.UI.Gtk.Display.Statusbar ( --- * Description +-- * Detail -- -- | A 'Statusbar' is usually placed along the bottom of an application's main -- 'Window'. It may provide a regular commentary of the application's status @@ -103,76 +103,107 @@ -------------------- -- Constructors --- | Create a new Statusbar. +-- | Creates a new 'Statusbar' ready for messages. -- statusbarNew :: IO Statusbar -statusbarNew = makeNewObject mkStatusbar $ - liftM castPtr {#call unsafe statusbar_new#} +statusbarNew = + makeNewObject mkStatusbar $ liftM castPtr $ + {# call unsafe statusbar_new #} -------------------- -- Methods type ContextId = {#type guint#} --- | Given a context description, this function --- returns a ContextId. This id can be used to later remove entries form the --- Statusbar. +-- | Returns a new context identifier, given a description of the actual +-- context. This id can be used to later remove entries form the Statusbar. -- -statusbarGetContextId :: StatusbarClass sb => sb -> String -> IO ContextId -statusbarGetContextId sb description = withUTFString description $ - {#call unsafe statusbar_get_context_id#} (toStatusbar sb) - +statusbarGetContextId :: StatusbarClass self => self + -> String -- ^ @contextDescription@ - textual description of what context the + -- new message is being used in. + -> IO ContextId -- ^ returns an id that can be used to later remove entries + -- ^ from the Statusbar. +statusbarGetContextId self contextDescription = + withUTFString contextDescription $ \contextDescriptionPtr -> + {# call unsafe statusbar_get_context_id #} + (toStatusbar self) + contextDescriptionPtr type MessageId = {#type guint#} --- | Push a new message on the Statusbar stack. It will +-- | Pushes a new message onto the Statusbar's stack. It will -- be displayed as long as it is on top of the stack. -- -statusbarPush :: StatusbarClass sb => sb -> ContextId -> String -> IO MessageId -statusbarPush sb context msg = withUTFString msg $ {#call statusbar_push#} - (toStatusbar sb) context +statusbarPush :: StatusbarClass self => self + -> ContextId -- ^ @contextId@ - the message's context id, as returned by + -- 'statusbarGetContextId'. + -> String -- ^ @text@ - the message to add to the statusbar. + -> IO MessageId -- ^ returns the message's new message id for use with + -- 'statusbarRemove'. +statusbarPush self contextId text = + withUTFString text $ \textPtr -> + {# call statusbar_push #} + (toStatusbar self) + contextId + textPtr --- | Pops the topmost message that has the correct --- context. +-- | Removes the topmost message that has the correct context. -- -statusbarPop :: StatusbarClass sb => sb -> ContextId -> IO () -statusbarPop sb context = {#call statusbar_pop#} (toStatusbar sb) context +statusbarPop :: StatusbarClass self => self + -> ContextId -- ^ @contextId@ - the context identifier used when the + -- message was added. + -> IO () +statusbarPop self contextId = + {# call statusbar_pop #} + (toStatusbar self) + contextId --- | Remove an entry within the stack. +-- | Forces the removal of a message from a statusbar's stack. The exact +-- @contextId@ and @messageId@ must be specified. -- -statusbarRemove :: StatusbarClass sb => sb -> ContextId -> MessageId -> IO () -statusbarRemove sb context message = {#call statusbar_remove#} (toStatusbar sb) - context message +statusbarRemove :: StatusbarClass self => self + -> ContextId -- ^ @contextId@ - a context identifier. + -> MessageId -- ^ @messageId@ - a message identifier, as returned by + -- 'statusbarPush'. + -> IO () +statusbarRemove self contextId messageId = + {# call statusbar_remove #} + (toStatusbar self) + contextId + messageId --- | Toggle the displaying of a resize grip. +-- | Sets whether the statusbar has a resize grip. @True@ by default. -- -statusbarSetHasResizeGrip :: StatusbarClass sb => sb -> Bool -> IO () -statusbarSetHasResizeGrip sb set = {#call statusbar_set_has_resize_grip#} - (toStatusbar sb) (fromBool set) +statusbarSetHasResizeGrip :: StatusbarClass self => self -> Bool -> IO () +statusbarSetHasResizeGrip self setting = + {# call statusbar_set_has_resize_grip #} + (toStatusbar self) + (fromBool setting) --- | Query the displaying of the resize grip. +-- | Returns whether the statusbar has a resize grip. -- -statusbarGetHasResizeGrip :: StatusbarClass sb => sb -> IO Bool -statusbarGetHasResizeGrip sb = liftM toBool $ - {#call unsafe statusbar_get_has_resize_grip#} (toStatusbar sb) +statusbarGetHasResizeGrip :: StatusbarClass self => self -> IO Bool +statusbarGetHasResizeGrip self = + liftM toBool $ + {# call unsafe statusbar_get_has_resize_grip #} + (toStatusbar self) -------------------- -- Signals -- | Called if a message is removed. -- -onTextPopped, afterTextPopped :: StatusbarClass sb => sb -> - (ContextId -> String -> IO ()) -> - IO (ConnectId sb) +onTextPopped, afterTextPopped :: StatusbarClass self => self + -> (ContextId -> String -> IO ()) + -> IO (ConnectId self) onTextPopped = connect_WORD_STRING__NONE "text-popped" False afterTextPopped = connect_WORD_STRING__NONE "text-popped" True -- | Called if a message is pushed on top of the -- stack. -- -onTextPushed, afterTextPushed :: StatusbarClass sb => sb -> - (ContextId -> String -> IO ()) -> - IO (ConnectId sb) +onTextPushed, afterTextPushed :: StatusbarClass self => self + -> (ContextId -> String -> IO ()) + -> IO (ConnectId self) onTextPushed = connect_WORD_STRING__NONE "text-pushed" False afterTextPushed = connect_WORD_STRING__NONE "text-pushed" True - Index: AccelLabel.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Display/AccelLabel.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- AccelLabel.chs 25 Feb 2005 01:11:32 -0000 1.3 +++ AccelLabel.chs 15 Mar 2005 19:59:09 -0000 1.4 @@ -24,10 +24,10 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- A label which displays an accelerator key on the right of the text. +-- A label which displays an accelerator key on the right of the text -- module Graphics.UI.Gtk.Display.AccelLabel ( --- * Description +-- * Detail -- -- | The 'AccelLabel' widget is a subclass of 'Label' that also displays an -- accelerator key on the right of the label text, e.g. \'Ctl+S\'. It is @@ -90,28 +90,35 @@ -------------------- -- Constructors --- | Create a new label with an accelerator key. +-- | Creates a new 'AccelLabel'. -- accelLabelNew :: String -> IO AccelLabel -accelLabelNew str = withUTFString str $ \strPtr -> makeNewObject mkAccelLabel $ - liftM castPtr $ {#call unsafe accel_label_new#} strPtr +accelLabelNew string = + makeNewObject mkAccelLabel $ liftM castPtr $ + withUTFString string $ \stringPtr -> + {# call unsafe accel_label_new #} + stringPtr -------------------- -- Methods --- | Set the key name from the activation --- signal of another widget. +-- | Sets the widget to be monitored by this accelerator label. -- -accelLabelSetAccelWidget :: (AccelLabelClass acl, WidgetClass w) => acl -> w -> - IO () -accelLabelSetAccelWidget acl w = {#call accel_label_set_accel_widget#} - (toAccelLabel acl) (toWidget w) +accelLabelSetAccelWidget :: (AccelLabelClass self, WidgetClass accelWidget) => self + -> accelWidget -- ^ @accelWidget@ - the widget to be monitored. + -> IO () +accelLabelSetAccelWidget self accelWidget = + {# call accel_label_set_accel_widget #} + (toAccelLabel self) + (toWidget accelWidget) --- | Fetches the widget monitored by this accelerator label, or Nothing if it --- has not bee set. +-- | Fetches the widget monitored by this accelerator label. See +-- 'accelLabelSetAccelWidget'. -- -accelLabelGetAccelWidget :: AccelLabelClass acl => acl -> IO (Maybe Widget) -accelLabelGetAccelWidget acl = do - wPtr <- {#call unsafe accel_label_get_accel_widget#} (toAccelLabel acl) - if wPtr==nullPtr then return Nothing else liftM Just $ - makeNewObject mkWidget (return wPtr) +accelLabelGetAccelWidget :: AccelLabelClass self => self + -> IO (Maybe Widget) -- ^ returns the object monitored by the accelerator + -- label, or @Nothing@. +accelLabelGetAccelWidget self = + maybeNull (makeNewObject mkWidget) $ + {# call unsafe accel_label_get_accel_widget #} + (toAccelLabel self) Index: Label.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Display/Label.chs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Label.chs 13 Mar 2005 19:34:32 -0000 1.5 +++ Label.chs 15 Mar 2005 19:59:09 -0000 1.6 @@ -24,10 +24,10 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- A widget that displays a small to medium amount of text. +-- A widget that displays a small to medium amount of text -- module Graphics.UI.Gtk.Display.Label ( --- * Description +-- * Detail -- -- | The 'Label' widget displays a small amount of text. As the name implies, -- most labels are used to label another widget such as a 'Button', a @@ -175,39 +175,65 @@ -------------------- -- Constructors --- | Create a new label widget. +-- | Creates a new label with the given text inside it. You can pass @Nothing@ +-- to get an empty label widget. -- labelNew :: Maybe String -> IO Label -labelNew str = makeNewObject mkLabel $ liftM castPtr $ - case str of - Nothing -> {#call label_new#} nullPtr - (Just str) -> withUTFString str {#call label_new#} +labelNew str = + makeNewObject mkLabel $ liftM castPtr $ + maybeWith withUTFString str $ \strPtr -> + {# call label_new #} + strPtr --- | Create a new label widget with accelerator key. +-- | Creates a new 'Label', containing the given text. -- --- * Each underscore in @str@ is converted into an underlined character in the --- label. Entering this character will activate the label widget or any other --- widget set with 'labelSetMnemonicWidget'. +-- If characters in @text@ are preceded by an underscore, they are +-- underlined. If you need a literal underscore character in a label, use +-- \'__\' (two underscores). The first underlined character represents a +-- keyboard accelerator called a mnemonic. The mnemonic key can be used to +-- activate another widget, chosen automatically, or explicitly using +-- 'labelSetMnemonicWidget'. -- -labelNewWithMnemonic :: String -> IO Label -labelNewWithMnemonic str = makeNewObject mkLabel $ liftM castPtr $ - withUTFString str {#call label_new_with_mnemonic#} +-- If 'labelSetMnemonicWidget' is not called, then the first activatable +-- ancestor of the 'Label' will be chosen as the mnemonic widget. For instance, +-- if the label is inside a button or menu item, the button or menu item will +-- automatically become the mnemonic widget and be activated by the mnemonic. +-- +labelNewWithMnemonic :: + String -- ^ @text@ - The text of the label, with an underscore in front + -- of the mnemonic character + -> IO Label +labelNewWithMnemonic str = + makeNewObject mkLabel $ liftM castPtr $ + withUTFString str $ \strPtr -> + {# call label_new_with_mnemonic #} + strPtr -------------------- -- Methods --- | Set the text the label widget shows. +-- | Sets the text within the 'Label' widget. It overwrites any text that was +-- there before. -- -labelSetText :: LabelClass l => l -> String -> IO () -labelSetText l str = - withUTFString str $ {#call label_set_text#} (toLabel l) +-- This will also clear any previously set mnemonic accelerators. +-- +labelSetText :: LabelClass self => self -> String -> IO () +labelSetText self str = + withUTFString str $ \strPtr -> + {# call label_set_text #} + (toLabel self) + strPtr --- | The label is interpreted as including embedded underlines and\/or Pango --- markup depending on the markup and underline properties. +-- | Sets the text of the label. The label is interpreted as including +-- embedded underlines and\/or Pango markup depending on the markup and +-- underline properties. -- -labelSetLabel :: LabelClass l => l -> String -> IO () -labelSetLabel l str = - withUTFString str $ {#call label_set_label#} (toLabel l) +labelSetLabel :: LabelClass self => self -> String -> IO () +labelSetLabel self str = + withUTFString str $ \strPtr -> + {# call label_set_label #} + (toLabel self) + strPtr {- -- | Set the text attributes. @@ -215,174 +241,293 @@ -- labelSetAttributes :: LabelClass l => PangoAttrList -> IO () -} --- | Set the label to a markup string. +-- | Parses @str@ which is marked up with the Pango text markup language, +-- setting the label's text and attribute list based on the parse results. If +-- the @str@ is external data, you may need to escape it. -- -labelSetMarkup :: LabelClass l => l -> Markup -> IO () -labelSetMarkup l str = - withUTFString str $ {#call label_set_markup#} (toLabel l) +labelSetMarkup :: LabelClass self => self + -> Markup -- ^ @str@ - a markup string (see Pango markup format) + -> IO () +labelSetMarkup self str = + withUTFString str $ \strPtr -> + {# call label_set_markup #} + (toLabel self) + strPtr --- | Set the label to a markup string and interpret keyboard accelerators. +-- | Parses @str@ which is marked up with the Pango text markup language, +-- setting the label's text and attribute list based on the parse results. If +-- characters in @str@ are preceded by an underscore, they are underlined +-- indicating that they represent a keyboard accelerator called a mnemonic. -- -labelSetMarkupWithMnemonic :: LabelClass l => l -> Markup -> IO () -labelSetMarkupWithMnemonic l str = - withUTFString str $ {#call label_set_markup_with_mnemonic#} (toLabel l) +-- The mnemonic key can be used to activate another widget, chosen +-- automatically, or explicitly using 'labelSetMnemonicWidget'. +-- +labelSetMarkupWithMnemonic :: LabelClass self => self + -> Markup -- ^ @str@ - a markup string (see Pango markup format) + -> IO () +labelSetMarkupWithMnemonic self str = + withUTFString str $ \strPtr -> + {# call label_set_markup_with_mnemonic #} + (toLabel self) + strPtr -- | Underline parts of the text, odd indices of the list represent underlined -- parts. -- labelSetPattern :: LabelClass l => l -> [Int] -> IO () -labelSetPattern l list = - withUTFString str $ {#call label_set_pattern#} (toLabel l) +labelSetPattern self list = + withUTFString str $ + {# call label_set_pattern #} + (toLabel self) where str = concat $ zipWith replicate list (cycle ['_',' ']) --- | Set the justification of the label. +-- | Sets the alignment of the lines in the text of the label relative to each +-- other. 'JustifyLeft' is the default value when the widget is first created +-- with 'labelNew'. If you instead want to set the alignment of the label as a +-- whole, use 'miscSetAlignment' instead. 'labelSetJustify' has no effect on +-- labels containing only a single line. -- -labelSetJustify :: LabelClass l => l -> Justification -> IO () -labelSetJustify l j = - {#call label_set_justify#} (toLabel l) ((fromIntegral.fromEnum) j) +labelSetJustify :: LabelClass self => self -> Justification -> IO () +labelSetJustify self jtype = + {# call label_set_justify #} + (toLabel self) + ((fromIntegral . fromEnum) jtype) --- | Get the justification of the label. +-- | Returns the justification of the label. See 'labelSetJustify'. -- -labelGetJustify :: LabelClass l => l -> IO Justification -labelGetJustify l = - liftM (toEnum.fromIntegral) $ {#call unsafe label_get_justify#} (toLabel l) +labelGetJustify :: LabelClass self => self -> IO Justification +labelGetJustify self = + liftM (toEnum . fromIntegral) $ + {# call unsafe label_get_justify #} + (toLabel self) --- | Gets the "PangoLayout" used to display the label. +-- | Gets the 'Layout' used to display the label. The layout is useful to e.g. +-- convert text positions to pixel positions, in combination with +-- 'labelGetLayoutOffsets'. -- -labelGetLayout :: LabelClass l => l -> IO PangoLayout -labelGetLayout l = - makeNewGObject mkPangoLayout $ {#call unsafe label_get_layout#} (toLabel l) +labelGetLayout :: LabelClass self => self + -> IO PangoLayout -- ^ returns the 'Layout' for this label +labelGetLayout self = + makeNewGObject mkPangoLayout $ + {# call unsafe label_get_layout #} + (toLabel self) --- | Set wether lines should be wrapped (@True@) or truncated (@False@). +-- | Toggles line wrapping within the 'Label' widget. @True@ makes it break +-- lines if text exceeds the widget's size. @False@ lets the text get cut off +-- by the edge of the widget if it exceeds the widget size. -- -labelSetLineWrap :: LabelClass l => l -> Bool -> IO () -labelSetLineWrap l w = {#call label_set_line_wrap#} (toLabel l) (fromBool w) +labelSetLineWrap :: LabelClass self => self + -> Bool -- ^ @wrap@ - the setting + -> IO () +labelSetLineWrap self wrap = + {# call label_set_line_wrap #} + (toLabel self) + (fromBool wrap) --- | Returns whether lines in the label are automatically wrapped. +-- | Returns whether lines in the label are automatically wrapped. See +-- 'labelSetLineWrap'. -- -labelGetLineWrap :: LabelClass l => l -> IO Bool -labelGetLineWrap l = liftM toBool $ - {#call unsafe label_get_line_wrap#} (toLabel l) +labelGetLineWrap :: LabelClass self => self + -> IO Bool -- ^ returns @True@ if the lines of the label are automatically + -- wrapped. +labelGetLineWrap self = + liftM toBool $ + {# call unsafe label_get_line_wrap #} + (toLabel self) --- | Get starting cooridinates of text rendering. +-- | Obtains the coordinates where the label will draw the 'Layout' +-- representing the text in the label; useful to convert mouse events into +-- coordinates inside the 'Layout', e.g. to take some action if some part of +-- the label is clicked. Of course you will need to create a 'EventBox' to +-- receive the events, and pack the label inside it, since labels are a +-- \'NoWindow\' widget. -- -labelGetLayoutOffsets :: LabelClass l => l -> IO (Int,Int) -labelGetLayoutOffsets l = - alloca (\xPtr -> - alloca (\yPtr -> do - {#call unsafe label_get_layout_offsets#} (toLabel l) xPtr yPtr - x <- peek xPtr - y <- peek yPtr - return (fromIntegral x,fromIntegral y) - ) - ) +labelGetLayoutOffsets :: LabelClass self => self -> IO (Int,Int) +labelGetLayoutOffsets self = + alloca $ \xPtr -> + alloca $ \yPtr -> do + {# call unsafe label_get_layout_offsets #} + (toLabel self) + xPtr + yPtr + x <- peek xPtr + y <- peek yPtr + return (fromIntegral x,fromIntegral y) -- | KeyVal is a synonym for a hot key number. -- type KeyVal = {#type guint#} --- | Get the keyval for the underlined character in the label. +-- | If the label has been set so that it has an mnemonic key this function +-- returns the keyval used for the mnemonic accelerator. -- -labelGetMnemonicKeyval :: LabelClass l => l -> IO KeyVal -labelGetMnemonicKeyval l = - {#call unsafe label_get_mnemonic_keyval#} (toLabel l) +labelGetMnemonicKeyval :: LabelClass self => self -> IO KeyVal +labelGetMnemonicKeyval self = + {# call unsafe label_get_mnemonic_keyval #} + (toLabel self) --- | Get whether the text selectable. +-- | Gets whether the text selectable. -- -labelGetSelectable :: LabelClass l => l -> IO Bool -labelGetSelectable l = liftM toBool $ - {#call unsafe label_get_selectable#} (toLabel l) +labelGetSelectable :: LabelClass self => self + -> IO Bool -- ^ returns @True@ if the user can copy text from the label +labelGetSelectable self = + liftM toBool $ + {# call unsafe label_get_selectable #} + (toLabel self) -- | Sets whether the text of the label contains markup in Pango's text markup --- language. +-- language. See 'labelSetMarkup'. -- -labelSetUseMarkup :: LabelClass l => l -> Bool -> IO () -labelSetUseMarkup l useMarkup = - {#call label_set_use_markup#} (toLabel l) (fromBool useMarkup) +labelSetUseMarkup :: LabelClass self => self + -> Bool -- ^ @setting@ - @True@ if the label's text should be parsed for + -- markup. + -> IO () +labelSetUseMarkup self setting = + {# call label_set_use_markup #} + (toLabel self) + (fromBool setting) -- | Returns whether the label's text is interpreted as marked up with the --- Pango text markup language. +-- Pango text markup language. See 'labelSetUseMarkup'. -- -labelGetUseMarkup :: LabelClass l => l -> IO Bool -labelGetUseMarkup l = liftM toBool $ - {#call unsafe label_get_use_markup#} (toLabel l) +labelGetUseMarkup :: LabelClass self => self + -> IO Bool -- ^ returns @True@ if the label's text will be parsed for markup. +labelGetUseMarkup self = + liftM toBool $ + {# call unsafe label_get_use_markup #} + (toLabel self) --- | If @True@, an underline in the text indicates the next character should --- be used for the mnemonic accelerator key. +-- | If @True@, an underline in the text indicates the next character should be +-- used for the mnemonic accelerator key. -- -labelSetUseUnderline :: LabelClass l => l -> Bool -> IO () -labelSetUseUnderline l useUnderline = - {#call label_set_use_underline#} (toLabel l) (fromBool useUnderline) +labelSetUseUnderline :: LabelClass self => self -> Bool -> IO () +labelSetUseUnderline self useUnderline = + {# call label_set_use_underline #} + (toLabel self) + (fromBool useUnderline) -- | Returns whether an embedded underline in the label indicates a mnemonic. +-- See 'labelSetUseUnderline'. -- -labelGetUseUnderline :: LabelClass l => l -> IO Bool -labelGetUseUnderline l = liftM toBool $ - {#call unsafe label_get_use_underline#} (toLabel l) +labelGetUseUnderline :: LabelClass self => self -> IO Bool +labelGetUseUnderline self = + liftM toBool $ + {# call unsafe label_get_use_underline #} + (toLabel self) --- | Get the text stored in the label. This does not include any embedded --- underlines indicating mnemonics or Pango markup. +-- | Gets the text from a label widget, as displayed on the screen. This +-- does not include any embedded underlines indicating mnemonics or Pango +-- markup. (See 'labelGetLabel') -- -labelGetText :: LabelClass l => l -> IO String -labelGetText l = {#call unsafe label_get_text#} (toLabel l) >>= peekUTFString +labelGetText :: LabelClass self => self -> IO String +labelGetText self = + {# call unsafe label_get_text #} + (toLabel self) + >>= peekUTFString --- | Get the text from a label widget including any embedded underlines --- indicating mnemonics and Pango markup. +-- | Gets the text from a label widget including any embedded underlines +-- indicating mnemonics and Pango markup. (See 'labelGetText'). -- -labelGetLabel :: LabelClass l => l -> IO String -labelGetLabel l = {#call unsafe label_get_label#} (toLabel l) >>= peekUTFString +labelGetLabel :: LabelClass self => self -> IO String +labelGetLabel self = + {# call unsafe label_get_label #} + (toLabel self) + >>= peekUTFString --- | Select a region in the label. +-- | Selects a range of characters in the label, if the label is selectable. +-- See 'labelSetSelectable'. If the label is not selectable, this function has +-- no effect. If @startOffset@ or @endOffset@ are -1, then the end of the label +-- will be substituted. -- -labelSelectRegion :: LabelClass l => l -> Int -> Int -> IO () -labelSelectRegion l start end = {#call label_select_region#} (toLabel l) - (fromIntegral start) (fromIntegral end) +labelSelectRegion :: LabelClass self => self + -> Int -- ^ @startOffset@ - start offset + -> Int -- ^ @endOffset@ - end offset + -> IO () +labelSelectRegion self startOffset endOffset = + {# call label_select_region #} + (toLabel self) + (fromIntegral startOffset) + (fromIntegral endOffset) -- | Gets the selected range of characters in the label, if any. If there is -- a range selected the result is the start and end of the selection as -- character offsets. -- -labelGetSelectionBounds :: LabelClass l => l -> IO (Maybe (Int, Int)) -labelGetSelectionBounds l = - alloca $ \startPtr -> alloca $ \endPtr -> do +labelGetSelectionBounds :: LabelClass self => self + -> IO (Maybe (Int, Int)) +labelGetSelectionBounds self = + alloca $ \startPtr -> + alloca $ \endPtr -> do isSelection <- - {#call unsafe label_get_selection_bounds#} (toLabel l) startPtr endPtr - if toBool isSelection + liftM toBool $ + {# call unsafe label_get_selection_bounds #} + (toLabel self) + startPtr + endPtr + if isSelection then do start <- peek startPtr end <- peek endPtr return $ Just $ (fromIntegral start, fromIntegral end) else return Nothing --- | Set an explicit widget for which to emit the \"mnemonic_activate\" signal --- if an underlined character is pressed. +-- | If the label has been set so that it has an mnemonic key (using i.e. +-- 'labelSetMarkupWithMnemonic', 'labelSetTextWithMnemonic', +-- 'labelNewWithMnemonic' or the \"use_underline\" property) the label can be +-- associated with a widget that is the target of the mnemonic. When the label +-- is inside a widget (like a 'Button' or a 'Notebook' tab) it is automatically +-- associated with the correct widget, but sometimes (i.e. when the target is a +-- 'Entry' next to the label) you need to set it explicitly using this +-- function. -- -labelSetMnemonicWidget :: (LabelClass l, WidgetClass w) => l -> w -> IO () -labelSetMnemonicWidget l w = - {#call unsafe label_set_mnemonic_widget#} (toLabel l) (toWidget w) - --- | Retrieves the target of the mnemonic (keyboard shortcut) of this label, --- or Nothing if none has been set and the default algorithm will be used. +-- The target widget will be accelerated by emitting \"mnemonic_activate\" +-- on it. The default handler for this signal will activate the widget if there +-- are no mnemonic collisions and toggle focus between the colliding widgets +-- otherwise. -- -labelGetMnemonicWidget :: LabelClass l => l -> IO (Maybe Widget) -labelGetMnemonicWidget l = do - widgetPtr <- {#call unsafe label_get_mnemonic_widget#} (toLabel l) - if widgetPtr == nullPtr - then return Nothing - else liftM Just $ makeNewObject mkWidget (return widgetPtr) +labelSetMnemonicWidget :: (LabelClass self, WidgetClass widget) => self + -> widget -- ^ @widget@ - the target 'Widget' + -> IO () +labelSetMnemonicWidget self widget = + {# call unsafe label_set_mnemonic_widget #} + (toLabel self) + (toWidget widget) --- | Make a label text selectable. +-- | Retrieves the target of the mnemonic (keyboard shortcut) of this label. +-- See 'labelSetMnemonicWidget'. -- -labelSetSelectable :: LabelClass l => l -> Bool -> IO () -labelSetSelectable l s = - {#call unsafe label_set_selectable#} (toLabel l) (fromBool s) +labelGetMnemonicWidget :: LabelClass self => self + -> IO (Maybe Widget) -- ^ returns the target of the label's mnemonic, or + -- @Nothing@ if none has been set and the default + -- algorithm will be used. +labelGetMnemonicWidget self = + maybeNull (makeNewObject mkWidget) $ + {# call unsafe label_get_mnemonic_widget #} + (toLabel self) --- | Set the label to a markup string and interpret keyboard accelerators. +-- | Selectable labels allow the user to select text from the label, for +-- copy-and-paste. -- -labelSetTextWithMnemonic :: LabelClass l => l -> String -> IO () -labelSetTextWithMnemonic l str = - withUTFString str $ {#call label_set_text_with_mnemonic#} (toLabel l) +labelSetSelectable :: LabelClass self => self + -> Bool -- ^ @setting@ - @True@ to allow selecting text in the label + -> IO () +labelSetSelectable self setting = + {# call unsafe label_set_selectable #} + (toLabel self) + (fromBool setting) +-- | Sets the label's text from the given string. If characters in the string are +-- preceded by an underscore, they are underlined indicating that they +-- represent a keyboard accelerator called a mnemonic. The mnemonic key can be +-- used to activate another widget, chosen automatically, or explicitly using +-- 'labelSetMnemonicWidget'. +-- +labelSetTextWithMnemonic :: LabelClass self => self -> String -> IO () +labelSetTextWithMnemonic self str = + withUTFString str $ \strPtr -> + {# call label_set_text_with_mnemonic #} + (toLabel self) + strPtr -------------------- -- Properties |
From: Duncan C. <dun...@us...> - 2005-03-15 19:49:54
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Abstract In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2707/gtk/Graphics/UI/Gtk/Abstract Modified Files: Range.chs Log Message: Haddock markup fixes. Index: Range.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Abstract/Range.chs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Range.chs 14 Mar 2005 23:55:07 -0000 1.6 +++ Range.chs 15 Mar 2005 19:49:40 -0000 1.7 @@ -264,7 +264,7 @@ -- | Emitted when the range is adjusted by user action. Note the value can be -- outside the bounds of the range since it depends on the mouse position. -- --- Usually you should use 'onValueChanged' / 'afterValueChanged' instead. +-- Usually you should use 'onValueChanged' \/ 'afterValueChanged' instead. -- onAdjustBounds, afterAdjustBounds :: RangeClass self => self -> (Double -> IO ()) @@ -275,7 +275,7 @@ -- | Emitted when the user presses a key (e.g. Page Up, Home, Right Arrow) to -- move the slider. The 'ScrollType' parameter gives the key that was pressed. -- --- Usually you should use 'onValueChanged' / 'afterValueChanged' instead. +-- Usually you should use 'onValueChanged' \/ 'afterValueChanged' instead. -- onMoveSlider, afterMoveSlider :: RangeClass self => self -> (ScrollType -> IO ()) |
From: Duncan C. <dun...@us...> - 2005-03-15 19:49:50
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2707 Modified Files: ChangeLog Log Message: Haddock markup fixes. Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.384 retrieving revision 1.385 diff -u -d -r1.384 -r1.385 --- ChangeLog 15 Mar 2005 19:47:30 -0000 1.384 +++ ChangeLog 15 Mar 2005 19:49:40 -0000 1.385 @@ -9,6 +9,8 @@ gtk/Graphics/UI/Gtk/Buttons/ToggleButton.chs: documentation changes and code formatting changes. + * gtk/Graphics/UI/Gtk/Abstract/Range.chs: Haddock markup fixes. + 2005-03-14 Duncan Coutts <du...@co...> * gtk/Graphics/UI/Gtk/Gdk/Region.chs.pp: segfault bug fix. Clear up |
From: Duncan C. <dun...@us...> - 2005-03-15 19:48:12
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2191 Modified Files: ChangeLog Log Message: Documentation changes and code formatting changes. Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.383 retrieving revision 1.384 diff -u -d -r1.383 -r1.384 --- ChangeLog 15 Mar 2005 19:44:59 -0000 1.383 +++ ChangeLog 15 Mar 2005 19:47:30 -0000 1.384 @@ -4,6 +4,11 @@ marshaling functions to help marshal values that might be NULL into a Maybe type where NULL gets mapped to Nothing. + * gtk/Graphics/UI/Gtk/Buttons/Button.chs.pp, + gtk/Graphics/UI/Gtk/Buttons/CheckButton.chs, + gtk/Graphics/UI/Gtk/Buttons/ToggleButton.chs: documentation changes + and code formatting changes. + 2005-03-14 Duncan Coutts <du...@co...> * gtk/Graphics/UI/Gtk/Gdk/Region.chs.pp: segfault bug fix. Clear up |
From: Duncan C. <dun...@us...> - 2005-03-15 19:47:58
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Buttons In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2191/gtk/Graphics/UI/Gtk/Buttons Modified Files: Button.chs.pp CheckButton.chs ToggleButton.chs Log Message: Documentation changes and code formatting changes. Index: CheckButton.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Buttons/CheckButton.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- CheckButton.chs 25 Feb 2005 01:11:32 -0000 1.3 +++ CheckButton.chs 15 Mar 2005 19:47:47 -0000 1.4 @@ -24,10 +24,10 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- create widgets with a discrete toggle button. +-- Create widgets with a discrete toggle button -- module Graphics.UI.Gtk.Buttons.CheckButton ( --- * Description +-- * Detail -- -- | A 'CheckButton' places a discrete 'ToggleButton' next to a widget, -- (usually a 'Label'). See the section on 'ToggleButton' widgets for more @@ -73,27 +73,34 @@ -------------------- -- Constructors --- | Create a new button with a check field. +-- | Creates a new 'CheckButton'. -- checkButtonNew :: IO CheckButton -checkButtonNew = makeNewObject mkCheckButton $ - liftM castPtr {#call unsafe check_button_new#} +checkButtonNew = + makeNewObject mkCheckButton $ liftM castPtr $ + {# call unsafe check_button_new #} --- | Create a new CheckButton with a text to --- the right of it. +-- | Creates a new 'CheckButton' with a 'Label' to the right of it. -- -checkButtonNewWithLabel :: String -> IO CheckButton -checkButtonNewWithLabel lbl = withUTFString lbl (\strPtr -> +checkButtonNewWithLabel :: + String -- ^ @label@ - the text for the check button. + -> IO CheckButton +checkButtonNewWithLabel label = makeNewObject mkCheckButton $ liftM castPtr $ - {#call unsafe check_button_new_with_label#} strPtr) + withUTFString label $ \labelPtr -> + {# call unsafe check_button_new_with_label #} + labelPtr --- | Create a checkButton with an --- accelerator key. --- --- * Like 'checkButtonNewWithLabel' but turns every underscore in --- the label to a underlined character. +-- | Creates a new 'CheckButton' containing a label. The label will be created +-- using 'labelNewWithMnemonic', so underscores in @label@ indicate the +-- mnemonic for the check button. -- -checkButtonNewWithMnemonic :: String -> IO CheckButton -checkButtonNewWithMnemonic lbl = withUTFString lbl (\strPtr -> - makeNewObject mkCheckButton $ liftM castPtr $ - {#call unsafe check_button_new_with_mnemonic#} strPtr) +checkButtonNewWithMnemonic :: + String -- ^ @label@ - The text of the button, with an underscore + -- in front of the mnemonic character + -> IO CheckButton +checkButtonNewWithMnemonic label = + makeNewObject mkCheckButton $ liftM castPtr $ + withUTFString label $ \labelPtr -> + {# call unsafe check_button_new_with_mnemonic #} + labelPtr Index: ToggleButton.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Buttons/ToggleButton.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ToggleButton.chs 13 Mar 2005 19:34:32 -0000 1.4 +++ ToggleButton.chs 15 Mar 2005 19:47:47 -0000 1.5 @@ -24,10 +24,10 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- Create buttons which retain their state. +-- Create buttons which retain their state -- module Graphics.UI.Gtk.Buttons.ToggleButton ( --- * Description +-- * Detail -- -- | A 'ToggleButton' is a 'Button' which will remain \'pressed-in\' when -- clicked. Clicking again will cause the toggle button to return to its normal @@ -99,77 +99,128 @@ -------------------- -- Constructors --- | Create a new ToggleButton widget. +-- | Creates a new toggle button. A widget should be packed into the button, +-- as in 'buttonNew'. -- toggleButtonNew :: IO ToggleButton -toggleButtonNew = makeNewObject mkToggleButton $ liftM castPtr - {#call unsafe toggle_button_new#} - +toggleButtonNew = + makeNewObject mkToggleButton $ liftM castPtr $ + {# call unsafe toggle_button_new #} --- | Create a ToggleButton with a label in it. +-- | Creates a new toggle button with a text label. -- -toggleButtonNewWithLabel :: String -> IO ToggleButton -toggleButtonNewWithLabel lbl = withUTFString lbl (\strPtr -> +toggleButtonNewWithLabel :: + String -- ^ @label@ - a string containing the message to be + -- placed in the toggle button. + -> IO ToggleButton +toggleButtonNewWithLabel label = makeNewObject mkToggleButton $ liftM castPtr $ - {#call unsafe toggle_button_new_with_label#} strPtr) + withUTFString label $ \labelPtr -> + {# call unsafe toggle_button_new_with_label #} + labelPtr --- | Create a ToggleButton with a label in it. Underscores in label indicate the +-- | Creates a new 'ToggleButton' containing a label. The label will be +-- created using 'labelNewWithMnemonic', so underscores in @label@ indicate the -- mnemonic for the button. -- -toggleButtonNewWithMnemonic :: String -> IO ToggleButton -toggleButtonNewWithMnemonic lbl = withUTFString lbl (\strPtr -> +toggleButtonNewWithMnemonic :: + String -- ^ @label@ - the text of the button, with an underscore + -- in front of the mnemonic character + -> IO ToggleButton +toggleButtonNewWithMnemonic label = makeNewObject mkToggleButton $ liftM castPtr $ - {#call unsafe toggle_button_new_with_mnemonic#} strPtr) + withUTFString label $ \labelPtr -> + {# call unsafe toggle_button_new_with_mnemonic #} + labelPtr -------------------- -- 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@ +-- You can call this function on a 'CheckButton' or a 'RadioButton' with @False@ -- to make the button look like a normal button. -- -toggleButtonSetMode :: ToggleButtonClass tb => tb -> Bool -> IO () -toggleButtonSetMode tb mode = - {#call toggle_button_set_mode#} (toToggleButton tb) (fromBool mode) +-- This function only effects instances of classes like 'CheckButton' and +-- 'RadioButton' that derive from 'ToggleButton', not instances of +-- 'ToggleButton' itself. +-- +toggleButtonSetMode :: ToggleButtonClass self => self + -> Bool -- ^ @drawIndicator@ - if @True@, draw the button as a separate + -- indicator and label; if @False@, draw the button like a normal + -- button + -> IO () +toggleButtonSetMode self drawIndicator = + {# call toggle_button_set_mode #} + (toToggleButton self) + (fromBool drawIndicator) -- | Retrieves whether the button is displayed as a separate indicator and --- label. +-- label. See 'toggleButtonSetMode'. -- -toggleButtonGetMode :: ToggleButtonClass tb => tb -> IO Bool -toggleButtonGetMode tb = - liftM toBool $ {#call unsafe toggle_button_get_mode#} (toToggleButton tb) +toggleButtonGetMode :: ToggleButtonClass self => self + -> IO Bool -- ^ returns @True@ if the togglebutton is drawn as a separate + -- indicator and label. +toggleButtonGetMode self = + liftM toBool $ + {# call unsafe toggle_button_get_mode #} + (toToggleButton self) --- | Emit the 'toggled' signal on the button. +-- | Emits the toggled signal on the 'ToggleButton'. There is no good reason +-- for an application ever to call this function. -- -toggleButtonToggled :: ToggleButtonClass tb => tb -> IO () -toggleButtonToggled tb = {#call toggle_button_toggled#} (toToggleButton tb) +toggleButtonToggled :: ToggleButtonClass self => self -> IO () +toggleButtonToggled self = + {# call toggle_button_toggled #} + (toToggleButton self) --- | Retrieve the current state of the button. Returns True if the button is --- depressed. +-- | Queries a 'ToggleButton' and returns its current state. Returns @True@ if +-- the toggle button is pressed in and @False@ if it is raised. -- -toggleButtonGetActive :: ToggleButtonClass tb => tb -> IO Bool -toggleButtonGetActive tb = liftM toBool $ - {#call unsafe toggle_button_get_active#} (toToggleButton tb) +toggleButtonGetActive :: ToggleButtonClass self => self + -> IO Bool +toggleButtonGetActive self = + liftM toBool $ + {# call unsafe toggle_button_get_active #} + (toToggleButton self) --- | Sets the state of the ToggleButton. True means the button should be --- depressed. +-- | Sets the status of the toggle button. Set to @True@ if you want the +-- 'ToggleButton' to be \'pressed in\', and @False@ to raise it. This action +-- causes the toggled signal to be emitted. -- -toggleButtonSetActive :: ToggleButtonClass tb => tb -> Bool -> IO () -toggleButtonSetActive tb active = - {#call toggle_button_set_active#} (toToggleButton tb) (fromBool active) +toggleButtonSetActive :: ToggleButtonClass self => self + -> Bool -- ^ @isActive@ - @True@ or @False@. + -> IO () +toggleButtonSetActive self isActive = + {# call toggle_button_set_active #} + (toToggleButton self) + (fromBool isActive) --- | Retrieve the inconsistent flag of the button. An inconsistent state only --- visually affects the button. It will be displayed in an \"in-between\" state. +-- | Gets the value set by 'toggleButtonSetInconsistent'. -- -toggleButtonGetInconsistent :: ToggleButtonClass tb => tb -> IO Bool -toggleButtonGetInconsistent tb = liftM toBool $ - {#call unsafe toggle_button_get_inconsistent#} (toToggleButton tb) +toggleButtonGetInconsistent :: ToggleButtonClass self => self + -> IO Bool -- ^ returns @True@ if the button is displayed as inconsistent, + -- @False@ otherwise +toggleButtonGetInconsistent self = + liftM toBool $ + {# call unsafe toggle_button_get_inconsistent #} + (toToggleButton self) --- | Sets the inconsistent flag of the ToggleButton. +-- | If the user has selected a range of elements (such as some text or +-- spreadsheet cells) that are affected by a toggle button, and the current +-- values in that range are inconsistent, you may want to display the toggle in +-- an \"in between\" state. This function turns on \"in between\" display. +-- Normally you would turn off the inconsistent state again if the user toggles +-- the toggle button. This has to be done manually, +-- 'toggleButtonSetInconsistent' only affects visual appearance, it doesn't +-- affect the semantics of the button. -- -toggleButtonSetInconsistent :: ToggleButtonClass tb => tb -> Bool -> IO () -toggleButtonSetInconsistent tb incon = - {#call toggle_button_set_inconsistent#} (toToggleButton tb) (fromBool incon) +toggleButtonSetInconsistent :: ToggleButtonClass self => self + -> Bool -- ^ @setting@ - @True@ if state is inconsistent + -> IO () +toggleButtonSetInconsistent self setting = + {# call toggle_button_set_inconsistent #} + (toToggleButton self) + (fromBool setting) -------------------- -- Properties @@ -202,9 +253,11 @@ -------------------- -- Signals --- | Whenever the state of the button is changed, the toggled signal is emitted. +-- | Whenever the state of the button is changed, the toggled signal is +-- emitted. -- -onToggled, afterToggled :: ButtonClass b => b -> IO () -> IO (ConnectId b) +onToggled, afterToggled :: ToggleButtonClass self => self + -> IO () + -> IO (ConnectId self) onToggled = connect_NONE__NONE "toggled" False afterToggled = connect_NONE__NONE "toggled" True - Index: Button.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Buttons/Button.chs.pp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Button.chs.pp 13 Mar 2005 19:34:32 -0000 1.4 +++ Button.chs.pp 15 Mar 2005 19:47:31 -0000 1.5 @@ -24,10 +24,10 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- A widget that creates a signal when clicked on. +-- A widget that creates a signal when clicked on -- module Graphics.UI.Gtk.Buttons.Button ( --- * Description +-- * Detail -- -- | 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 @@ -121,156 +121,255 @@ -------------------- -- Constructors --- | Create a new Button widget. +-- | Creates a new 'Button' widget. To add a child widget to the button, use +-- 'containerAdd'. -- buttonNew :: IO Button -buttonNew = makeNewObject mkButton $ liftM castPtr {#call unsafe button_new#} +buttonNew = + makeNewObject mkButton $ liftM castPtr $ + {# call unsafe button_new #} --- | Create a button with a label in it. +-- | Creates a 'Button' widget with a 'Label' child containing the given text. -- -buttonNewWithLabel :: String -> IO Button -buttonNewWithLabel lbl = withUTFString lbl (\strPtr -> +buttonNewWithLabel :: + String -- ^ @label@ - The text you want the 'Label' to hold. + -> IO Button +buttonNewWithLabel label = makeNewObject mkButton $ liftM castPtr $ - {#call unsafe button_new_with_label#} strPtr) + withUTFString label $ \labelPtr -> + {# call unsafe button_new_with_label #} + labelPtr --- | Create a button with an accelerator key. --- --- * Like 'buttonNewWithLabel' but turns every underscore in the --- label to a underlined character which then acts as a mnemonic (keyboard --- shortcut). +-- | Creates a new 'Button' containing a label. If characters in @label@ are +-- preceded by an underscore, they are underlined. If you need a literal +-- underscore character in a label, use \'__\' (two underscores). The first +-- underlined character represents a keyboard accelerator called a mnemonic. +-- Pressing Alt and that key activates the button. -- -buttonNewWithMnemonic :: String -> IO Button -buttonNewWithMnemonic lbl = withUTFString lbl (\strPtr -> - makeNewObject mkButton $ liftM castPtr $ - {#call unsafe button_new_with_mnemonic#} strPtr) +buttonNewWithMnemonic :: + String -- ^ @label@ - The text of the button, with an underscore in + -- front of the mnemonic character + -> IO Button +buttonNewWithMnemonic label = + makeNewObject mkButton $ liftM castPtr $ + withUTFString label $ \labelPtr -> + {# call unsafe button_new_with_mnemonic #} + labelPtr --- | Create a stock (predefined appearance) button. +-- | Creates a new 'Button' containing the image and text from a stock item. -- -buttonNewFromStock :: String -> IO Button -buttonNewFromStock stockId = withUTFString stockId (\strPtr -> +-- If @stockId@ is unknown, then it will be treated as a mnemonic label (as +-- for 'buttonNewWithMnemonic'). +-- +buttonNewFromStock :: + String -- ^ @stockId@ - the name of the stock item + -> IO Button +buttonNewFromStock stockId = makeNewObject mkButton $ liftM castPtr $ + withUTFString stockId $ \stockIdPtr -> throwIfNull "buttonNewFromStock: Invalid stock identifier." $ - {#call unsafe button_new_from_stock#} strPtr) + {# call unsafe button_new_from_stock #} + stockIdPtr -------------------- -- Methods --- | Depress the button, i.e. emit the pressed signal. +-- | Emits the button pressed signal for the given 'Button'. -- -buttonPressed :: ButtonClass b => b -> IO () -buttonPressed b = {#call button_pressed#} (toButton b) +buttonPressed :: ButtonClass self => self -> IO () +buttonPressed self = + {# call button_pressed #} + (toButton self) --- | Release the button, i.e. emit the released signal. +-- | Emits the button released signal for the given 'Button'. -- -buttonReleased :: ButtonClass b => b -> IO () -buttonReleased b = {#call button_released#} (toButton b) +buttonReleased :: ButtonClass self => self -> IO () +buttonReleased self = + {# call button_released #} + (toButton self) --- | Emit the clicked signal on the button. +-- | Emits the button clicked signal for the given 'Button'. -- --- * This is similar to calling 'buttonPressed' and --- 'buttonReleased' in sequence. +-- This is similar to calling 'buttonPressed' and 'buttonReleased' in sequence. -- -buttonClicked :: ButtonClass b => b -> IO () -buttonClicked b = {#call button_clicked#} (toButton b) +buttonClicked :: ButtonClass self => self -> IO () +buttonClicked self = + {# call button_clicked #} + (toButton self) -- | Emit the cursor enters signal to the button. -- -buttonEnter :: ButtonClass b => b -> IO () -buttonEnter b = {#call button_enter#} (toButton b) +buttonEnter :: ButtonClass self => self -> IO () +buttonEnter self = + {# call button_enter #} + (toButton self) -- | Emit the cursor leaves signal to the button. -- -buttonLeave :: ButtonClass b => b -> IO () -buttonLeave b = {#call button_leave#} (toButton b) +buttonLeave :: ButtonClass self => self -> IO () +buttonLeave self = + {# call button_leave #} + (toButton self) --- | Set the style of the button edges. +-- | Sets the relief style of the edges of the given 'Button' widget. Three +-- styles exist, 'ReliefNormal', 'ReliefHalf', 'ReliefNone'. The default style +-- is, as one can guess, 'ReliefNormal'. -- -buttonSetRelief :: ButtonClass b => b -> ReliefStyle -> IO () -buttonSetRelief b rs = - {#call button_set_relief#} (toButton b) ((fromIntegral.fromEnum) rs) +buttonSetRelief :: ButtonClass self => self + -> ReliefStyle -- ^ @newstyle@ - The 'ReliefStyle' as described above. + -> IO () +buttonSetRelief self newstyle = + {# call button_set_relief #} + (toButton self) + ((fromIntegral . fromEnum) newstyle) --- | Get the current relief style. +-- | Returns the current relief style of the given 'Button'. -- -buttonGetRelief :: ButtonClass b => b -> IO ReliefStyle -buttonGetRelief b = liftM (toEnum.fromIntegral) $ - {#call unsafe button_get_relief#} (toButton b) +buttonGetRelief :: ButtonClass self => self + -> IO ReliefStyle -- ^ returns The current 'ReliefStyle' +buttonGetRelief self = + liftM (toEnum . fromIntegral) $ + {# call unsafe button_get_relief #} + (toButton self) --- | Set the text of the button. +-- | Sets the text of the label of the button. This text is also used +-- to select the stock item if 'buttonSetUseStock' is used. -- -buttonSetLabel :: ButtonClass b => b -> String -> IO () -buttonSetLabel b lbl = withUTFString lbl $ \strPtr -> - {#call button_set_label#} (toButton b) strPtr - --- | Get the current text on the button. +-- This will also clear any previously set labels. -- --- * The method returns the empty string in case the button does not have --- a label (e.g. it was created with 'buttonNew'. +buttonSetLabel :: ButtonClass self => self -> String -> IO () +buttonSetLabel self label = + withUTFString label $ \labelPtr -> + {# call button_set_label #} + (toButton self) + labelPtr + +-- | Gets the text from the label of the button, as set by +-- 'buttonSetLabel'. If the label text has not been set the return value will +-- be @\"\"@. +-- This will be the case if you create an empty button with 'buttonNew' to use +-- as a container. -- -buttonGetLabel :: ButtonClass b => b -> IO String -buttonGetLabel b = do - strPtr <- {#call unsafe button_get_label#} (toButton b) +buttonGetLabel :: ButtonClass self => self -> IO String +buttonGetLabel self = do + strPtr <- {# call unsafe button_get_label #} + (toButton self) if strPtr==nullPtr then return "" else peekUTFString strPtr --- | Set if the label is a stock identifier. +-- | If true, the label set on the button is used as a stock id to select the +-- stock item for the button. -- --- * Setting this property to @True@ will make the button lookup --- its label in the table of stock items. If there is a match, the button --- will use the stock item instead of the label. You need to set this --- flag before you change the label. +-- Setting this property to @True@ will make the button lookup its label in +-- the table of stock items. If there is a match, the button will use the +-- stock item instead of the label. You need to set this flag before you +-- change the label. -- -buttonSetUseStock :: ButtonClass b => b -> Bool -> IO () -buttonSetUseStock b flag = - {#call button_set_use_stock#} (toButton b) (fromBool flag) +buttonSetUseStock :: ButtonClass self => self + -> Bool -- ^ @useStock@ - @True@ if the button should use a stock item + -> IO () +buttonSetUseStock self useStock = + {# call button_set_use_stock #} + (toButton self) + (fromBool useStock) --- | Get the current flag for stock lookups. +-- | Returns whether the button label is a stock item. -- -buttonGetUseStock :: ButtonClass b => b -> IO Bool -buttonGetUseStock b = liftM toBool $ - {#call unsafe button_get_use_stock#} (toButton b) +buttonGetUseStock :: ButtonClass self => self + -> IO Bool -- ^ returns @True@ if the button label is used to select a stock + -- item instead of being used directly as the label text. +buttonGetUseStock self = + liftM toBool $ + {# call unsafe button_get_use_stock #} + (toButton self) --- | Set if the label has accelerators. +-- | If true, an underline in the text of the button label indicates the next +-- character should be used for the mnemonic accelerator key. -- --- * Setting this property will make the button join any underline character --- into the following letter and inserting this letter as a keyboard --- shortcut. You need to set this flag before you change the label. +-- Setting this property will make the button join any underline character +-- into the following letter and inserting this letter as a keyboard shortcut. +-- You need to set this flag before you change the label. -- -buttonSetUseUnderline :: ButtonClass b => b -> Bool -> IO () -buttonSetUseUnderline b flag = - {#call button_set_use_underline#} (toButton b) (fromBool flag) +buttonSetUseUnderline :: ButtonClass self => self + -> Bool -- ^ @useUnderline@ - @True@ if underlines in the text indicate + -- mnemonics + -> IO () +buttonSetUseUnderline self useUnderline = + {# call button_set_use_underline #} + (toButton self) + (fromBool useUnderline) --- | Query if the underlines are mnemonics. +-- | Returns whether an embedded underline in the button label indicates a +-- mnemonic. See 'buttonSetUseUnderline'. -- -buttonGetUseUnderline :: ButtonClass b => b -> IO Bool -buttonGetUseUnderline b = liftM toBool $ - {#call unsafe button_get_use_underline#} (toButton b) +buttonGetUseUnderline :: ButtonClass self => self + -> IO Bool -- ^ returns @True@ if an embedded underline in the button label + -- indicates the mnemonic accelerator keys. +buttonGetUseUnderline self = + liftM toBool $ + {# call unsafe button_get_use_underline #} + (toButton self) #if GTK_CHECK_VERSION(2,4,0) --- | Sets whether the button will grab focus when it is clicked with the mouse. +-- | Sets whether the button will grab focus when it is clicked with the +-- mouse. Making mouse clicks not grab focus is useful in places like toolbars +-- where you don't want the keyboard focus removed from the main area of the +-- application. -- -buttonSetFocusOnClick :: ButtonClass b => b -> Bool -> IO () -buttonSetFocusOnClick b focus = - {#call unsafe button_set_focus_on_click#} (toButton b) (fromBool focus) +-- * Available since Gtk version 2.4 +-- +buttonSetFocusOnClick :: ButtonClass self => self + -> Bool -- ^ @focusOnClick@ - whether the button grabs focus when clicked + -- with the mouse + -> IO () +buttonSetFocusOnClick self focusOnClick = + {# call unsafe button_set_focus_on_click #} + (toButton self) + (fromBool focusOnClick) --- | Gets whether the button grabs focus when it is clicked with the mouse. +-- | Returns whether the button grabs focus when it is clicked with the mouse. +-- See 'buttonSetFocusOnClick'. -- -buttonGetFocusOnClick :: ButtonClass b => b -> IO Bool -buttonGetFocusOnClick b = liftM toBool $ - {#call unsafe button_get_focus_on_click#} (toButton b) +-- * Available since Gtk version 2.4 +-- +buttonGetFocusOnClick :: ButtonClass self => self + -> IO Bool -- ^ returns @True@ if the button grabs focus when it is clicked + -- with the mouse. +buttonGetFocusOnClick self = + liftM toBool $ + {# call unsafe button_get_focus_on_click #} + (toButton self) -- | Sets the alignment of the child. This has no effect unless the child --- derives from "Misc" "Aligment". +-- derives from 'Misc' 'Aligment'. -- -buttonSetAlignment :: ButtonClass b => b -> (Float, Float) -> IO () -buttonSetAlignment b (xalign, yalign) = - {#call unsafe button_set_alignment#} (toButton b) - (realToFrac xalign) (realToFrac yalign) +-- * Available since Gtk version 2.4 +-- +buttonSetAlignment :: ButtonClass self => self + -> (Float, Float) -- ^ @(xalign, yalign)@ - the horizontal position of the + -- child (0.0 is left aligned, 1.0 is right aligned) and + -- the vertical position of the child (0.0 is top aligned, + -- 1.0 is bottom aligned) + -> IO () +buttonSetAlignment self (xalign, yalign) = + {# call unsafe button_set_alignment #} + (toButton self) + (realToFrac xalign) + (realToFrac yalign) -- | Gets the alignment of the child in the button. -- -buttonGetAlignment :: ButtonClass b => b -> IO (Float, Float) -buttonGetAlignment b = - alloca $ \xalignPtr -> alloca $ \yalignPtr -> do - {#call unsafe button_get_alignment#} (toButton b) xalignPtr yalignPtr +-- * Available since Gtk version 2.4 +-- +buttonGetAlignment :: ButtonClass self => self + -> IO (Float, Float) -- ^ @(xalign,yalign)@ - horizontal and vertical + -- alignment +buttonGetAlignment self = + alloca $ \xalignPtr -> + alloca $ \yalignPtr -> do + {# call unsafe button_get_alignment #} + (toButton self) + xalignPtr + yalignPtr xalign <- peek xalignPtr yalign <- peek yalignPtr return (realToFrac xalign, realToFrac yalign) @@ -353,18 +452,8 @@ onPressed = connect_NONE__NONE "pressed" False afterPressed = connect_NONE__NONE "pressed" True - -- | The button is released. -- onReleased, afterReleased :: ButtonClass b => b -> IO () -> IO (ConnectId b) onReleased = connect_NONE__NONE "released" False afterReleased = connect_NONE__NONE "released" True - - - - - - - - - |
From: Duncan C. <dun...@us...> - 2005-03-15 19:45:13
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1483 Modified Files: ChangeLog Log Message: Add maybeNull function which is used by marshaling functions to help marshal values that might be NULL into a Maybe type where NULL gets mapped to Nothing. Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.382 retrieving revision 1.383 diff -u -d -r1.382 -r1.383 --- ChangeLog 14 Mar 2005 23:55:05 -0000 1.382 +++ ChangeLog 15 Mar 2005 19:44:59 -0000 1.383 @@ -1,3 +1,9 @@ +2005-03-15 Duncan Coutts <du...@co...> + + * glib/System/Glib/FFI.hs: add maybeNull function which is used by + marshaling functions to help marshal values that might be NULL into a + Maybe type where NULL gets mapped to Nothing. + 2005-03-14 Duncan Coutts <du...@co...> * gtk/Graphics/UI/Gtk/Gdk/Region.chs.pp: segfault bug fix. Clear up |
From: Duncan C. <dun...@us...> - 2005-03-15 19:45:12
|
Update of /cvsroot/gtk2hs/gtk2hs/glib/System/Glib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1483/glib/System/Glib Modified Files: FFI.hs Log Message: Add maybeNull function which is used by marshaling functions to help marshal values that might be NULL into a Maybe type where NULL gets mapped to Nothing. Index: FFI.hs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/glib/System/Glib/FFI.hs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- FFI.hs 16 Jan 2005 21:29:41 -0000 1.2 +++ FFI.hs 15 Mar 2005 19:45:01 -0000 1.3 @@ -28,6 +28,7 @@ module System.Glib.FFI ( with, nullForeignPtr, + maybeNull, foreignFree, newForeignPtr, foreignPtrToPtr, @@ -77,3 +78,12 @@ foreignFree = free #endif +-- A marshaling utility function that is used by the code produced by the code +-- generator to marshal return values that can be null +maybeNull :: (IO (Ptr a) -> IO a) -> IO (Ptr a) -> IO (Maybe a) +maybeNull marshal genPtr = do + ptr <- genPtr + if ptr == nullPtr + then return Nothing + else do result <- marshal (return ptr) + return (Just result) |
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Abstract In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24514/gtk/Graphics/UI/Gtk/Abstract Modified Files: Bin.chs Box.chs ButtonBox.chs.pp Misc.chs Paned.chs.pp Range.chs Scale.chs Scrollbar.hs Separator.hs Log Message: Documentation changes and code formatting changes. Index: Range.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Abstract/Range.chs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Range.chs 13 Mar 2005 19:34:32 -0000 1.5 +++ Range.chs 14 Mar 2005 23:55:07 -0000 1.6 @@ -74,7 +74,9 @@ -- * Signals onMoveSlider, - afterMoveSlider + afterMoveSlider, + onAdjustBounds, + afterAdjustBounds, ) where import Monad (liftM) @@ -91,80 +93,126 @@ -------------------- -- Methods --- | Extract the 'Adjustment' object. +-- | Get the 'Adjustment' which is the \"model\" object for 'Range'. See +-- 'rangeSetAdjustment' for details. -- -rangeGetAdjustment :: RangeClass r => r -> IO Adjustment -rangeGetAdjustment r = makeNewObject mkAdjustment $ - {#call unsafe range_get_adjustment#} (toRange r) +rangeGetAdjustment :: RangeClass self => self + -> IO Adjustment -- ^ returns a 'Adjustment' +rangeGetAdjustment self = + makeNewObject mkAdjustment $ + {# call unsafe range_get_adjustment #} + (toRange self) --- | Insert a new 'Adjustment' object. +-- | Sets the adjustment to be used as the \"model\" object for this range +-- widget. The adjustment indicates the current range value, the minimum and +-- maximum range values, the step\/page increments used for keybindings and +-- scrolling, and the page size. The page size is normally 0 for 'Scale' and +-- nonzero for 'Scrollbar', and indicates the size of the visible area of the +-- widget being scrolled. The page size affects the size of the scrollbar +-- slider. -- -rangeSetAdjustment :: RangeClass r => r -> Adjustment -> IO () -rangeSetAdjustment r adj = {#call range_set_adjustment#} (toRange r) adj +rangeSetAdjustment :: RangeClass self => self + -> Adjustment -- ^ @adjustment@ - a 'Adjustment' + -> IO () +rangeSetAdjustment self adjustment = + {# call range_set_adjustment #} + (toRange self) + adjustment --- | Get the update policy for the range widget. +-- | Gets the update policy of @range@. See 'rangeSetUpdatePolicy'. -- -rangeGetUpdatePolicy :: RangeClass r => r -> IO UpdateType -rangeGetUpdatePolicy r = liftM (toEnum.fromIntegral) $ - {#call unsafe range_get_update_policy#} (toRange r) +rangeGetUpdatePolicy :: RangeClass self => self + -> IO UpdateType -- ^ returns the current update policy +rangeGetUpdatePolicy self = + liftM (toEnum . fromIntegral) $ + {# call unsafe range_get_update_policy #} + (toRange self) --- | Set how the internal 'Adjustment' object is updated. --- --- * The value of 'UpdateType' determines how frequently value-changed --- signals are emitted on the internal 'Adjustment' object. +-- | Sets the update policy for the range. 'UpdateContinuous' means that +-- anytime the range slider is moved, the range value will change and the +-- value_changed signal will be emitted. 'UpdateDelayed' means that the value +-- will be updated after a brief timeout where no slider motion occurs, so +-- updates are spaced by a short time rather than continuous. +-- 'UpdateDiscontinuous' means that the value will only be updated when the +-- user releases the button and ends the slider drag operation. -- -rangeSetUpdatePolicy :: RangeClass r => r -> UpdateType -> IO () -rangeSetUpdatePolicy r up = {#call range_set_update_policy#} - (toRange r) ((fromIntegral.fromEnum) up) +rangeSetUpdatePolicy :: RangeClass self => self + -> UpdateType -- ^ @policy@ - update policy + -> IO () +rangeSetUpdatePolicy self policy = + {# call range_set_update_policy #} + (toRange self) + ((fromIntegral . fromEnum) policy) --- | Get the inverted flag (determines if the range is reversed). +-- | Gets the value set by 'rangeSetInverted'. -- -rangeGetInverted :: RangeClass r => r -> IO Bool -rangeGetInverted r = - liftM toBool $ {#call unsafe range_get_inverted#} (toRange r) +rangeGetInverted :: RangeClass self => self + -> IO Bool -- ^ returns @True@ if the range is inverted +rangeGetInverted self = + liftM toBool $ + {# call unsafe range_get_inverted #} + (toRange self) --- | Set the inverted flag. +-- | Ranges normally move from lower to higher values as the slider moves from +-- top to bottom or left to right. Inverted ranges have higher values at the +-- top or on the right rather than on the bottom or left. -- -rangeSetInverted :: RangeClass r => r -> Bool -> IO () -rangeSetInverted r inv = {#call range_set_inverted#} (toRange r) (fromBool inv) +rangeSetInverted :: RangeClass self => self + -> Bool -- ^ @setting@ - @True@ to invert the range + -> IO () +rangeSetInverted self setting = + {# call range_set_inverted #} + (toRange self) + (fromBool setting) -- | Gets the current value of the range. -- -rangeGetValue :: RangeClass r => r -> IO Double -rangeGetValue r = liftM realToFrac $ - {#call unsafe range_get_value#} (toRange r) +rangeGetValue :: RangeClass self => self + -> IO Double -- ^ returns current value of the range. +rangeGetValue self = + liftM realToFrac $ + {# call unsafe range_get_value #} + (toRange self) --- | Sets the current value of the range. The range emits the \"value_changed\" --- signal if the value changes. --- --- * If the value is outside the minimum or maximum range values, it will be --- clamped to fit inside them. +-- | Sets the current value of the range; if the value is outside the minimum +-- or maximum range values, it will be clamped to fit inside them. The range +-- emits the \"value_changed\" signal if the value changes. -- -rangeSetValue :: RangeClass r => r -> Double -> IO () -rangeSetValue r value = - {#call range_set_value#} (toRange r) (realToFrac value) +rangeSetValue :: RangeClass self => self + -> Double -- ^ @value@ - new value of the range + -> IO () +rangeSetValue self value = + {# call range_set_value #} + (toRange self) + (realToFrac value) --- | Sets the step and page sizes for the range. --- The step size is used when the --- user clicks the "Scrollbar" arrows or moves "Scale" via arrow keys. The +-- | Sets the step and page sizes for the range. The step size is used when +-- the user clicks the 'Scrollbar' arrows or moves 'Scale' via arrow keys. The -- page size is used for example when moving via Page Up or Page Down keys. -- -rangeSetIncrements :: RangeClass r => r - -> Double -- ^ step size - -> Double -- ^ page size - -> IO () -rangeSetIncrements r step page = - {#call range_set_increments#} (toRange r) (realToFrac step) (realToFrac page) +rangeSetIncrements :: RangeClass self => self + -> Double -- ^ @step@ - step size + -> Double -- ^ @page@ - page size + -> IO () +rangeSetIncrements self step page = + {# call range_set_increments #} + (toRange self) + (realToFrac step) + (realToFrac page) --- | Sets the allowable values in the 'Range', and clamps the range value to be --- between min and max. +-- | Sets the allowable values in the 'Range', and clamps the range value to +-- be between @min@ and @max@. (If the range has a non-zero page size, it is +-- clamped between @min@ and @max@ - page-size.) -- -rangeSetRange :: RangeClass r => r - -> Double -- ^ min - -> Double -- ^ max - -> IO () -rangeSetRange r min max = - {#call range_set_range#} (toRange r) (realToFrac min) (realToFrac max) +rangeSetRange :: RangeClass self => self + -> Double -- ^ @min@ - minimum range value + -> Double -- ^ @max@ - maximum range value + -> IO () +rangeSetRange self min max = + {# call range_set_range #} + (toRange self) + (realToFrac min) + (realToFrac max) -------------------- -- Properties @@ -204,10 +252,33 @@ -------------------- -- Signals --- | The slide has moved. The arguments give --- detailed information what happend. +-- | Emitted when the range value is changed either programmatically or by +-- user action. -- -onMoveSlider, afterMoveSlider :: RangeClass r => r -> (ScrollType -> IO ()) -> - IO (ConnectId r) -onMoveSlider = connect_ENUM__NONE "move-slider" False -afterMoveSlider = connect_ENUM__NONE "move-slider" True +onValueChanged, afterValueChanged :: RangeClass self => self + -> IO () + -> IO (ConnectId self) +onValueChanged = connect_NONE__NONE "value_changed" False +afterValueChanged = connect_NONE__NONE "value_changed" True + +-- | Emitted when the range is adjusted by user action. Note the value can be +-- outside the bounds of the range since it depends on the mouse position. +-- +-- Usually you should use 'onValueChanged' / 'afterValueChanged' instead. +-- +onAdjustBounds, afterAdjustBounds :: RangeClass self => self + -> (Double -> IO ()) + -> IO (ConnectId self) +onAdjustBounds = connect_DOUBLE__NONE "adjust_bounds" False +afterAdjustBounds = connect_DOUBLE__NONE "adjust_bounds" True + +-- | Emitted when the user presses a key (e.g. Page Up, Home, Right Arrow) to +-- move the slider. The 'ScrollType' parameter gives the key that was pressed. +-- +-- Usually you should use 'onValueChanged' / 'afterValueChanged' instead. +-- +onMoveSlider, afterMoveSlider :: RangeClass self => self + -> (ScrollType -> IO ()) + -> IO (ConnectId self) +onMoveSlider = connect_ENUM__NONE "move_slider" False +afterMoveSlider = connect_ENUM__NONE "move_slider" True Index: Bin.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Abstract/Bin.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Bin.chs 25 Feb 2005 22:53:40 -0000 1.4 +++ Bin.chs 14 Mar 2005 23:55:06 -0000 1.5 @@ -24,10 +24,10 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- This abstract widget implements a container with just one child. +-- A container with just one child -- module Graphics.UI.Gtk.Abstract.Bin ( --- * Description +-- * Detail -- -- | The 'Bin' widget is a container with just one child. It is not very -- useful itself, but it is useful for deriving subclasses, since it provides @@ -44,11 +44,11 @@ -- | +----'Widget' -- | +----'Container' -- | +----Bin +-- | +----'Window' -- | +----'Alignment' -- | +----'Frame' -- | +----'Button' -- | +----'Item' --- | +----'Window' -- | +----'ComboBox' -- | +----'EventBox' -- | +----'Expander' @@ -76,6 +76,11 @@ -------------------- -- Methods -binGetChild :: BinClass bin => bin -> IO Widget -binGetChild bin = - makeNewObject mkWidget $ {# call gtk_bin_get_child #} (toBin bin) +-- | Gets the child of the 'Bin' +-- +binGetChild :: BinClass self => self + -> IO Widget -- ^ returns the child of the 'Bin' +binGetChild self = + makeNewObject mkWidget $ + {# call gtk_bin_get_child #} + (toBin self) Index: Box.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Abstract/Box.chs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Box.chs 13 Mar 2005 19:34:31 -0000 1.5 +++ Box.chs 14 Mar 2005 23:55:07 -0000 1.6 @@ -24,11 +24,10 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- This abstract container class is instatiated by using HBox or VBox. It --- supplies all methods to add and remove children. +-- Base class for box containers -- module Graphics.UI.Gtk.Abstract.Box ( --- * Description +-- * Detail -- -- | 'Box' is an abstract widget which encapsulates functionallity for a -- particular kind of container, one that organizes a variable number of @@ -125,112 +124,195 @@ -------------------- -- Methods --- | Insert a widget at the beginning of the box --- container. +-- | Adds the @child@ widget to the box, packed with reference to the start of +-- the box. The +-- @child@ is packed after any other child packed with reference to the start +-- of the box. -- --- * The 'Packing' parameter determines how the child behaves in the --- horizontal or vertical way in an HBox or VBox, respectively. --- 'PackNatural' means the child is as big as it reqests. It will --- move to the left in an 'HBox' or to the top in an --- 'VBox' if there is more space availble. --- All children --- that have choosen 'PackRepel' for @p@ will be padded --- on both sides with --- additional space. 'PackGrow' will increase the size of the --- so that is covers the available space. +-- The 'Packing' parameter determines how the child behaves in the horizontal +-- or vertical way in an HBox or VBox, respectively. 'PackNatural' means the +-- child is as big as it reqests. It will move to the left in an 'HBox' or to +-- the top in an 'VBox' if there is more space availble. +-- All children packed with 'PackRepel' will be padded on both sides with +-- additional space. 'PackGrow' will increase the size of the so that is +-- covers the available space. -- -boxPackStart :: (BoxClass b, WidgetClass w) => b -> w -> Packing -> Int -> - IO () -boxPackStart b w p pad = {#call box_pack_start#} (toBox b) (toWidget w) - (fromBool $ p/=PackNatural) (fromBool $ p==PackGrow) (fromIntegral pad) +boxPackStart :: (BoxClass self, WidgetClass child) => self + -> child -- ^ @child@ - the 'Widget' to be added to the box. + -> Packing + -> Int -- ^ @padding@ - extra space in pixels to put between this child and + -- its neighbors, over and above the global amount specified by + -- spacing 'boxSetSpacing'. If @child@ + -- is a widget at one of the reference ends of @box@, then @padding@ + -- pixels are also put between @child@ and the reference edge of + -- @box@. + -> IO () +boxPackStart self child packing padding = + {# call box_pack_start #} + (toBox self) + (toWidget child) + (fromBool $ packing /= PackNatural) + (fromBool $ packing == PackGrow) + (fromIntegral padding) --- | Insert a widget at the end of the box container. +-- | Adds the @child@ widget to the box, packed with reference to the end of +-- the box. The +-- @child@ is packed after (away from end of) any other child packed with +-- reference to the end of the box. -- --- * See 'boxPackStart'. The option 'Natural' will --- move a child to the right in an 'HBox' or to the bottom in an --- 'VBox' if there is more space availble. +-- See 'boxPackStart' for a description of the 'Packing' parameter. Of course +-- for 'boxPackEnd' the 'PackNatural' option will move a child to the right in +-- an 'HBox' or to the bottom in an 'VBox' if there is more space availble. -- -boxPackEnd :: (BoxClass b, WidgetClass w) => b -> w -> Packing -> Int -> IO () -boxPackEnd b w p pad = {#call box_pack_end#} (toBox b) (toWidget w) - (fromBool $ p/=PackNatural) (fromBool $ p==PackGrow) (fromIntegral pad) +boxPackEnd :: (BoxClass self, WidgetClass child) => self + -> child -- ^ @child@ - the 'Widget' to be added to the box. + -> Packing + -> Int -- ^ @padding@ - extra space in pixels to put between this child and + -- its neighbors, over and above the global amount specified by + -- spacing 'boxSetSpacing'. If @child@ + -- is a widget at one of the reference ends of @box@, then @padding@ + -- pixels are also put between @child@ and the reference edge of + -- @box@. + -> IO () +boxPackEnd self child packing padding = + {# call box_pack_end #} + (toBox self) + (toWidget child) + (fromBool $ packing /= PackNatural) + (fromBool $ packing == PackGrow) + (fromIntegral padding) --- | Like 'boxPackStart' but uses the --- default parameters 'PackRepel' and 0 for padding. +-- | Like 'boxPackStart' but uses the default parameters 'PackRepel' and 0 for +-- padding. -- -boxPackStartDefaults :: (BoxClass b, WidgetClass w) => b -> w -> IO () -boxPackStartDefaults b w = - {#call box_pack_start_defaults#} (toBox b) (toWidget w) +boxPackStartDefaults :: (BoxClass self, WidgetClass widget) => self + -> widget -- ^ @widget@ - the 'Widget' to be added to the box. + -> IO () +boxPackStartDefaults self widget = + {# call box_pack_start_defaults #} + (toBox self) + (toWidget widget) --- | Like 'boxPackEnd' but uses the --- default parameters 'PackRepel' and 0 for padding. +-- | Like 'boxPackEnd' but uses the default parameters 'PackRepel' and 0 for +-- padding. -- -boxPackEndDefaults :: (BoxClass b, WidgetClass w) => b -> w -> IO () -boxPackEndDefaults b w = - {#call box_pack_end_defaults#} (toBox b) (toWidget w) +boxPackEndDefaults :: (BoxClass self, WidgetClass widget) => self + -> widget -- ^ @widget@ - the 'Widget' to be added to the box. + -> IO () +boxPackEndDefaults self widget = + {# call box_pack_end_defaults #} + (toBox self) + (toWidget widget) --- | Set if all children should be spread homogeneous --- within the box. +-- | Sets the homogeneous property, +-- controlling whether or not all children of the box are given equal space -- -boxSetHomogeneous :: BoxClass b => b -> Bool -> IO () -boxSetHomogeneous b homo = - {#call box_set_homogeneous#} (toBox b) (fromBool homo) +boxSetHomogeneous :: BoxClass self => self + -> Bool -- ^ @homogeneous@ - a boolean value, @True@ to create equal + -- allotments, @False@ for variable allotments. + -> IO () +boxSetHomogeneous self homogeneous = + {# call box_set_homogeneous #} + (toBox self) + (fromBool homogeneous) --- | Get whether the box is homogeneous. +-- | Returns whether the box is homogeneous (all children are the same size). +-- See 'boxSetHomogeneous'. -- -boxGetHomogeneous :: BoxClass b => b -> IO Bool -boxGetHomogeneous b = - liftM toBool $ {#call box_get_homogeneous#} (toBox b) +boxGetHomogeneous :: BoxClass self => self + -> IO Bool -- ^ returns @True@ if the box is homogeneous. +boxGetHomogeneous self = + liftM toBool $ + {# call box_get_homogeneous #} + (toBox self) -- | Set the standard spacing between two children. -- --- * This space is in addition to the padding parameter that is given for each --- child. +-- This space is in addition to the padding parameter that is given for each +-- child. -- -boxSetSpacing :: BoxClass b => b -> Int -> IO () -boxSetSpacing b spacing = - {#call box_set_spacing#} (toBox b) (fromIntegral spacing) +boxSetSpacing :: BoxClass self => self + -> Int -- ^ @spacing@ - the number of pixels to put between children. + -> IO () +boxSetSpacing self spacing = + {# call box_set_spacing #} + (toBox self) + (fromIntegral spacing) --- | Move @child@ to a new @position@ --- (counted from 0) in the box. +-- | Moves @child@ to a new @position@ in the list of @box@ children. The list +-- contains both widgets packed 'PackStart' as well as widgets packed +-- 'PackEnd', in the order that these widgets were added to the box. -- -boxReorderChild :: (BoxClass b, WidgetClass w) => b -> w -> Int -> IO () -boxReorderChild b w position = - {#call box_reorder_child#} (toBox b) (toWidget w) (fromIntegral position) +-- A widget's position in the box children list determines where the +-- widget is packed into the box. A child widget at some position in the list +-- will be packed just after all other widgets of the same packing type that +-- appear earlier in the list. +-- +boxReorderChild :: (BoxClass self, WidgetClass child) => self + -> child -- ^ @child@ - the 'Widget' to move. + -> Int -- ^ @position@ - the new position for @child@ in the children list + -- starting from 0. If negative, indicates the end of the list. + -> IO () +boxReorderChild self child position = + {# call box_reorder_child #} + (toBox self) + (toWidget child) + (fromIntegral position) --- | Query the packing parameter of a child. +-- | Returns information about how @child@ is packed into the box. -- --- * Returns information on the behaviour if free space is available --- (in 'Packing'), the additional padding for this widget and --- if the widget +-- Returns information on the behaviour if free space is available +-- (in 'Packing'), the additional padding for this widget and if the widget -- was inserted at the start or end of the container ('PackType'). -- -boxQueryChildPacking :: (BoxClass b, WidgetClass w) => b -> w -> - IO (Packing,Int,PackType) -boxQueryChildPacking b w = alloca $ \expandPtr -> alloca $ \fillPtr -> - alloca $ \paddingPtr -> alloca $ \packPtr -> do - {#call unsafe box_query_child_packing#} (toBox b) (toWidget w) - expandPtr fillPtr paddingPtr packPtr - expand <- liftM toBool $ peek expandPtr - fill <- liftM toBool $ peek fillPtr - padding <- liftM fromIntegral $ peek paddingPtr - pack <- liftM (toEnum.fromIntegral) $ peek packPtr - return (if fill then PackGrow else - (if expand then PackRepel else PackNatural), - padding,pack) +boxQueryChildPacking :: (BoxClass self, WidgetClass child) => self + -> child -- ^ @child@ - the 'Widget' of the child to query. + -> IO (Packing,Int,PackType) -- ^ @(packing, padding, packType)@ +boxQueryChildPacking self child = + alloca $ \expandPtr -> + alloca $ \fillPtr -> + alloca $ \paddingPtr -> + alloca $ \packPtr -> do + {# call unsafe box_query_child_packing #} + (toBox self) + (toWidget child) + expandPtr + fillPtr + paddingPtr + packPtr + expand <- liftM toBool $ peek expandPtr + fill <- liftM toBool $ peek fillPtr + padding <- liftM fromIntegral $ peek paddingPtr + pack <- liftM (toEnum.fromIntegral) $ peek packPtr + return (if fill then PackGrow else + (if expand then PackRepel else PackNatural), + padding,pack) --- | Set the packing parameter of a child. +-- | Sets the way @child@ is packed into the box. -- -boxSetChildPacking :: (BoxClass b, WidgetClass w) => b -> w -> Packing -> - Int -> PackType -> IO () -boxSetChildPacking b w pack pad pt = {#call box_set_child_packing#} (toBox b) - (toWidget w) (fromBool $ pack/=PackNatural) (fromBool $ pack==PackGrow) - (fromIntegral pad) ((fromIntegral.fromEnum) pt) +boxSetChildPacking :: (BoxClass self, WidgetClass child) => self + -> child -- ^ @child@ - the 'Widget' of the child to set. + -> Packing + -> Int -- ^ @padding@ + -> PackType -- ^ @packType@ + -> IO () +boxSetChildPacking self child packing padding packType = + {# call box_set_child_packing #} + (toBox self) + (toWidget child) + (fromBool $ packing /= PackNatural) + (fromBool $ packing == PackGrow) + (fromIntegral padding) + ((fromIntegral . fromEnum) packType) -- | Retrieves the standard spacing between widgets. -- -boxGetSpacing :: BoxClass b => b -> IO Int -boxGetSpacing b = - liftM fromIntegral $ {#call unsafe box_get_spacing#} (toBox b) +boxGetSpacing :: BoxClass self => self + -> IO Int -- ^ returns spacing between children +boxGetSpacing self = + liftM fromIntegral $ + {# call unsafe box_get_spacing #} + (toBox self) -------------------- -- Properties Index: ButtonBox.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Abstract/ButtonBox.chs.pp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ButtonBox.chs.pp 13 Mar 2005 19:34:32 -0000 1.4 +++ ButtonBox.chs.pp 14 Mar 2005 23:55:07 -0000 1.5 @@ -27,7 +27,7 @@ -- Base class for 'HButtonBox' and 'VButtonBox' -- module Graphics.UI.Gtk.Abstract.ButtonBox ( --- * Description +-- * Detail -- -- | The primary purpose of this class is to keep track of the various -- properties of 'HButtonBox' and 'VButtonBox' widgets. @@ -91,45 +91,63 @@ -------------------- -- Methods --- | Retrieve the method being used to --- arrange the buttons in the button box +-- | Retrieves the method being used to arrange the buttons in the button box. -- -buttonBoxGetLayout :: ButtonBoxClass b => b -> IO ButtonBoxStyle -buttonBoxGetLayout b = liftM (toEnum . fromIntegral) $ - {#call gtk_button_box_get_layout#} (toButtonBox b) +buttonBoxGetLayout :: ButtonBoxClass self => self + -> IO ButtonBoxStyle +buttonBoxGetLayout self = + liftM (toEnum . fromIntegral) $ + {# call gtk_button_box_get_layout #} + (toButtonBox self) #if GTK_CHECK_VERSION(2,4,0) --- | Returns whether child should appear --- in a secondary group of children +-- | Returns whether @child@ should appear in a secondary group of children. -- --- * Since Gtk 2.4. -buttonBoxGetChildSecondary :: (ButtonBoxClass b, WidgetClass w) => b -> w -> IO Bool -buttonBoxGetChildSecondary b w = liftM toBool $ - {#call gtk_button_box_get_child_secondary#} (toButtonBox b) (toWidget w) +-- * Available since Gtk version 2.4 +-- +buttonBoxGetChildSecondary :: (ButtonBoxClass self, WidgetClass child) => self + -> child -- ^ @child@ - a child of the button box widget + -> IO Bool -- ^ returns whether @child@ should appear in a secondary group of + -- children. +buttonBoxGetChildSecondary self child = + liftM toBool $ + {# call gtk_button_box_get_child_secondary #} + (toButtonBox self) + (toWidget child) #endif --- | Changes the way buttons are arranged in their container +-- | Changes the way buttons are arranged in their container. -- -buttonBoxSetLayout :: ButtonBoxClass b => b -> ButtonBoxStyle -> IO () -buttonBoxSetLayout b l = - {#call gtk_button_box_set_layout#} (toButtonBox b) - ((fromIntegral . fromEnum) l) +buttonBoxSetLayout :: ButtonBoxClass self => self + -> ButtonBoxStyle -- ^ @layoutStyle@ - the new layout style. + -> IO () +buttonBoxSetLayout self layoutStyle = + {# call gtk_button_box_set_layout #} + (toButtonBox self) + ((fromIntegral . fromEnum) layoutStyle) --- | Sets whether child should appear in a secondary --- group of children. A typical use of a secondary child is the help button in a dialog. +-- | Sets whether @child@ should appear in a secondary group of children. A +-- typical use of a secondary child is the help button in a dialog. -- --- * This group appears after the other children if the style is 'ButtonboxStart', --- 'ButtonboxSpread' or 'ButtonboxEdge', and before the the other children if the --- style is 'ButtonboxEnd'. For horizontal button boxes, the definition of before\/after --- depends on direction of the widget (see 'widgetSetDirection'). If the style is --- 'buttonBoxStart' or 'buttonBoxEnd', then the secondary children are aligned at --- the other end of the button box from the main children. For the other styles, --- they appear immediately next to the main children. +-- This group appears after the other children if the style is +-- 'ButtonboxStart', 'ButtonboxSpread' or 'ButtonboxEdge', and before the the +-- other children if the style is 'ButtonboxEnd'. For horizontal button boxes, +-- the definition of before\/after depends on direction of the widget (see +-- 'widgetSetDirection'). If the style is 'ButtonboxStart' or 'ButtonboxEnd', +-- then the secondary children are aligned at the other end of the button box +-- from the main children. For the other styles, they appear immediately next +-- to the main children. -- -buttonBoxSetChildSecondary :: (ButtonBoxClass b, WidgetClass w) => b -> w -> Bool -> IO () -buttonBoxSetChildSecondary b w s = - {#call gtk_button_box_set_child_secondary #} (toButtonBox b) (toWidget w) - (fromBool s) +buttonBoxSetChildSecondary :: (ButtonBoxClass self, WidgetClass child) => self + -> child -- ^ @child@ - a child of the button box widget + -> Bool -- ^ @isSecondary@ - if @True@, the @child@ appears in a secondary + -- group of the button box. + -> IO () +buttonBoxSetChildSecondary self child isSecondary = + {# call gtk_button_box_set_child_secondary #} + (toButtonBox self) + (toWidget child) + (fromBool isSecondary) -------------------- -- Properties Index: Separator.hs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Abstract/Separator.hs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Separator.hs 12 Feb 2005 17:19:21 -0000 1.2 +++ Separator.hs 14 Mar 2005 23:55:07 -0000 1.3 @@ -24,13 +24,31 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- This widget is the base class for HSeparator and VSeparator. +-- Base class for 'HSeparator' and 'VSeparator' -- module Graphics.UI.Gtk.Abstract.Separator ( +-- * Detail +-- +-- | The 'Separator' widget is an abstract class, used only for deriving the +-- subclasses 'HSeparator' and 'VSeparator'. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----Separator +-- | +----'HSeparator' +-- | +----'VSeparator' +-- @ + +-- * Types Separator, - SeparatorClass + SeparatorClass, + castToSeparator ) where -import Graphics.UI.Gtk.Types (Separator, SeparatorClass) +import Graphics.UI.Gtk.Types (Separator, SeparatorClass, castToSeparator) -- well this widget is very abstract! Index: Scrollbar.hs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Abstract/Scrollbar.hs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Scrollbar.hs 12 Feb 2005 17:19:21 -0000 1.2 +++ Scrollbar.hs 14 Mar 2005 23:55:07 -0000 1.3 @@ -24,12 +24,31 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- This is the abstract base class for HScrollbar and VScrollbar. +-- Base class for 'HScrollbar' and 'VScrollbar' -- module Graphics.UI.Gtk.Abstract.Scrollbar ( +-- * Detail +-- +-- | The 'Scrollbar' widget is an abstract base class for 'HScrollbar' and +-- 'VScrollbar'. It is not very useful in itself. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Range' +-- | +----Scrollbar +-- | +----'HScrollbar' +-- | +----'VScrollbar' +-- @ + +-- * Types Scrollbar, - ScrollbarClass + ScrollbarClass, + castToScrollbar ) where -import Graphics.UI.Gtk.Types (Scrollbar, ScrollbarClass) +import Graphics.UI.Gtk.Types (Scrollbar, ScrollbarClass, castToScrollbar) Index: Misc.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Abstract/Misc.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Misc.chs 25 Feb 2005 22:53:40 -0000 1.4 +++ Misc.chs 14 Mar 2005 23:55:07 -0000 1.5 @@ -24,10 +24,10 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- A base class for widgets with alignments and padding. +-- Base class for widgets with alignments and padding -- module Graphics.UI.Gtk.Abstract.Misc ( --- * Description +-- * Detail -- -- | The 'Misc' widget is an abstract widget which is not useful itself, but -- is used to derive subclasses which have alignment and padding attributes. @@ -76,34 +76,61 @@ -------------------- -- Methods --- | Set the alignment of the widget. +-- | Sets the alignment of the widget. -- -miscSetAlignment :: MiscClass m => m -> Double -> Double -> IO () -miscSetAlignment misc xalign yalign = {#call misc_set_alignment#} - (toMisc misc) (realToFrac xalign) (realToFrac yalign) - --- | Get the alignment of the widget. +miscSetAlignment :: MiscClass self => self + -> Float -- ^ @xalign@ - the horizontal alignment, from 0 (left) to 1 + -- (right). + -> Float -- ^ @yalign@ - the vertical alignment, from 0 (top) to 1 (bottom). + -> IO () +miscSetAlignment self xalign yalign = + {# call misc_set_alignment #} + (toMisc self) + (realToFrac xalign) + (realToFrac yalign) + +-- | Gets the X and Y alignment of the widget within its allocation. See +-- 'miscSetAlignment'. -- -miscGetAlignment :: MiscClass m => m -> IO (Double, Double) -miscGetAlignment misc = - alloca $ \xalignPtr -> alloca $ \yalignPtr -> do - {#call unsafe misc_get_alignment#} (toMisc misc) xalignPtr yalignPtr +miscGetAlignment :: MiscClass self => self + -> IO (Double, Double) +miscGetAlignment self = + alloca $ \xalignPtr -> + alloca $ \yalignPtr -> do + {# call unsafe misc_get_alignment #} + (toMisc self) + xalignPtr + yalignPtr xalign <- peek xalignPtr yalign <- peek yalignPtr return (realToFrac xalign, realToFrac yalign) --- | Set the amount of space to add around the widget. +-- | Sets the amount of space to add around the widget. -- -miscSetPadding :: MiscClass m => m -> Int -> Int -> IO () -miscSetPadding misc xpad ypad = {#call misc_set_padding#} - (toMisc misc) (fromIntegral xpad) (fromIntegral ypad) +miscSetPadding :: MiscClass self => self + -> Int -- ^ @xpad@ - the amount of space to add on the left and right of + -- the widget, in pixels. + -> Int -- ^ @ypad@ - the amount of space to add on the top and bottom of + -- the widget, in pixels. + -> IO () +miscSetPadding self xpad ypad = + {# call misc_set_padding #} + (toMisc self) + (fromIntegral xpad) + (fromIntegral ypad) --- | Get the amount of space added around the widget. +-- | Gets the padding in the X and Y directions of the widget. See +-- 'miscSetPadding'. -- -miscGetPadding :: MiscClass m => m -> IO (Int, Int) -miscGetPadding misc = - alloca $ \xpadPtr -> alloca $ \ypadPtr -> do - {#call unsafe misc_get_padding#} (toMisc misc) xpadPtr ypadPtr +miscGetPadding :: MiscClass self => self + -> IO (Int, Int) +miscGetPadding self = + alloca $ \xpadPtr -> + alloca $ \ypadPtr -> do + {# call unsafe misc_get_padding #} + (toMisc self) + xpadPtr + ypadPtr xpad <- peek xpadPtr ypad <- peek ypadPtr return (fromIntegral xpad, fromIntegral ypad) Index: Paned.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Abstract/Paned.chs.pp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Paned.chs.pp 13 Mar 2005 19:34:32 -0000 1.5 +++ Paned.chs.pp 14 Mar 2005 23:55:07 -0000 1.6 @@ -27,7 +27,7 @@ -- Base class for widgets with two adjustable panes -- module Graphics.UI.Gtk.Abstract.Paned ( --- * Description +-- * Detail -- -- | 'Paned' is the base class for widgets with two panes, arranged either -- horizontally ('HPaned') or vertically ('VPaned'). Child widgets are added to @@ -99,56 +99,100 @@ -------------------- -- Methods --- | Add a widget to the first (top or left) area. --- --- * The widget does not expand if 'Paned' expands. It does not shrink either. +-- | Adds a child to the top or left pane with default parameters. This is +-- equivalent to @'panedPack1' paned child False True@. -- -panedAdd1 :: (PanedClass p, WidgetClass w) => p -> w -> IO () -panedAdd1 p w = {#call paned_add1#} (toPaned p) (toWidget w) +panedAdd1 :: (PanedClass self, WidgetClass child) => self + -> child -- ^ @child@ - the child to add + -> IO () +panedAdd1 self child = + {# call paned_add1 #} + (toPaned self) + (toWidget child) --- | Add a widget to the second (bottom or right) area. --- --- * The widget does not expand if 'Paned' expands. But it does shrink. +-- | Adds a child to the bottom or right pane with default parameters. This is +-- equivalent to @'panedPack2' paned child True True@. -- -panedAdd2 :: (PanedClass p, WidgetClass w) => p -> w -> IO () -panedAdd2 p w = {#call paned_add2#} (toPaned p) (toWidget w) +panedAdd2 :: (PanedClass self, WidgetClass child) => self + -> child -- ^ @child@ - the child to add + -> IO () +panedAdd2 self child = + {# call paned_add2 #} + (toPaned self) + (toWidget child) --- | Add a widget to the first area and specify its resizing behaviour. +-- | Adds a child to the top or left pane. -- -panedPack1 :: (PanedClass p, WidgetClass w) => p -> w -> Bool -> Bool -> IO () -panedPack1 p w expand shrink = {#call paned_pack1#} - (toPaned p) (toWidget w) (fromBool expand) (fromBool shrink) +panedPack1 :: (PanedClass self, WidgetClass child) => self + -> child -- ^ @child@ - the child to add + -> Bool -- ^ @resize@ - should this child expand when the paned widget is + -- resized. + -> Bool -- ^ @shrink@ - can this child be made smaller than its requsition. + -> IO () +panedPack1 self child resize shrink = + {# call paned_pack1 #} + (toPaned self) + (toWidget child) + (fromBool resize) + (fromBool shrink) --- | Add a widget to the second area and specify its resizing behaviour. +-- | Adds a child to the bottom or right pane. -- -panedPack2 :: (PanedClass p, WidgetClass w) => p -> w -> Bool -> Bool -> IO () -panedPack2 p w expand shrink = {#call paned_pack2#} - (toPaned p) (toWidget w) (fromBool expand) (fromBool shrink) +panedPack2 :: (PanedClass self, WidgetClass child) => self + -> child -- ^ @child@ - the child to add + -> Bool -- ^ @resize@ - should this child expand when the paned widget is + -- resized. + -> Bool -- ^ @shrink@ - can this child be made smaller than its requsition. + -> IO () +panedPack2 self child resize shrink = + {# call paned_pack2 #} + (toPaned self) + (toWidget child) + (fromBool resize) + (fromBool shrink) --- | Set the gutter to the specified @position@ (in pixels). +-- | Sets the position of the divider between the two panes. -- -panedSetPosition :: PanedClass p => p -> Int -> IO () -panedSetPosition p position = - {#call paned_set_position#} (toPaned p) (fromIntegral position) +panedSetPosition :: PanedClass self => self + -> Int -- ^ @position@ - pixel position of divider, a negative value means + -- that the position is unset. + -> IO () +panedSetPosition self position = + {# call paned_set_position #} + (toPaned self) + (fromIntegral position) --- | Get the gutter position (in pixels). +-- | Obtains the position of the divider between the two panes. -- -panedGetPosition :: PanedClass p => p -> IO Int -panedGetPosition p = liftM fromIntegral $ - {#call unsafe paned_get_position#} (toPaned p) +panedGetPosition :: PanedClass self => self + -> IO Int -- ^ returns position of the divider +panedGetPosition self = + liftM fromIntegral $ + {# call unsafe paned_get_position #} + (toPaned self) #if GTK_CHECK_VERSION(2,4,0) -- | Obtains the first child of the paned widget. -- -panedGetChild1 :: PanedClass p => p -> IO Widget -panedGetChild1 p = - makeNewObject mkWidget $ {#call unsafe paned_get_child1#} (toPaned p) +-- * Available since Gtk version 2.4 +-- +panedGetChild1 :: PanedClass self => self + -> IO Widget -- ^ returns first child +panedGetChild1 self = + makeNewObject mkWidget $ + {# call unsafe paned_get_child1 #} + (toPaned self) -- | Obtains the second child of the paned widget. -- -panedGetChild2 :: PanedClass p => p -> IO Widget -panedGetChild2 p = - makeNewObject mkWidget $ {#call unsafe paned_get_child2#} (toPaned p) +-- * Available since Gtk version 2.4 +-- +panedGetChild2 :: PanedClass self => self + -> IO Widget -- ^ returns second child +panedGetChild2 self = + makeNewObject mkWidget $ + {# call unsafe paned_get_child2 #} + (toPaned self) #endif -------------------- Index: Scale.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Abstract/Scale.chs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Scale.chs 13 Mar 2005 19:34:32 -0000 1.5 +++ Scale.chs 14 Mar 2005 23:55:07 -0000 1.6 @@ -24,11 +24,10 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- This is the abstract base class for 'HScale' and 'VScale'. It implements --- the management of an adjustable value. +-- Base class for 'HScale' and 'VScale' -- module Graphics.UI.Gtk.Abstract.Scale ( --- * Description +-- * Detail -- -- | A 'Scale' is a slider control used to select a numeric value. To use it, -- you'll probably want to investigate the methods on its base class, 'Range', @@ -86,41 +85,69 @@ -------------------- -- Methods --- | Set the number of displayed digits after the comma. +-- | Sets the number of decimal places that are displayed in the value. Also +-- causes the value of the adjustment to be rounded off to this number of +-- digits, so the retrieved value matches the value the user saw. -- -scaleSetDigits :: ScaleClass s => s -> Int -> IO () -scaleSetDigits s prec = - {#call scale_set_digits#} (toScale s) (fromIntegral prec) +scaleSetDigits :: ScaleClass self => self + -> Int -- ^ @digits@ - the number of decimal places to display, e.g. use 1 + -- to display 1.0, 2 to display 1.00 etc. + -> IO () +scaleSetDigits self digits = + {# call scale_set_digits #} + (toScale self) + (fromIntegral digits) --- | Get the number of displayed digits after the comma. +-- | Gets the number of decimal places that are displayed in the value. -- -scaleGetDigits :: ScaleClass s => s -> IO Int -scaleGetDigits s = - liftM fromIntegral $ {#call unsafe scale_get_digits#} (toScale s) +scaleGetDigits :: ScaleClass self => self + -> IO Int -- ^ returns the number of decimal places that are displayed. +scaleGetDigits self = + liftM fromIntegral $ + {# call unsafe scale_get_digits #} + (toScale self) --- | Specify if the current value is to be drawn next to the slider. +-- | Specifies whether the current value is displayed as a string next to the +-- slider. -- -scaleSetDrawValue :: ScaleClass s => s -> Bool -> IO () -scaleSetDrawValue s draw = - {#call scale_set_draw_value#} (toScale s) (fromBool draw) +scaleSetDrawValue :: ScaleClass self => self + -> Bool -- ^ @drawValue@ - a boolean. + -> IO () +scaleSetDrawValue self drawValue = + {# call scale_set_draw_value #} + (toScale self) + (fromBool drawValue) --- | Returns whether the current value is drawn next to the slider. +-- | Returns whether the current value is displayed as a string next to the +-- slider. -- -scaleGetDrawValue :: ScaleClass s => s -> IO Bool -scaleGetDrawValue s = - liftM toBool $ {#call unsafe scale_get_draw_value#} (toScale s) +scaleGetDrawValue :: ScaleClass self => self + -> IO Bool -- ^ returns whether the current value is displayed as a string. +scaleGetDrawValue self = + liftM toBool $ + {# call unsafe scale_get_draw_value #} + (toScale self) --- | Specify where the value is to be displayed (relative to the slider). +-- | Sets the position in which the current value is displayed. -- -scaleSetValuePos :: ScaleClass s => s -> PositionType -> IO () -scaleSetValuePos s pos = - {#call scale_set_value_pos#} (toScale s) ((fromIntegral.fromEnum) pos) +scaleSetValuePos :: ScaleClass self => self + -> PositionType -- ^ @pos@ - the position in which the current value is + -- displayed. + -> IO () +scaleSetValuePos self pos = + {# call scale_set_value_pos #} + (toScale self) + ((fromIntegral . fromEnum) pos) -- | Gets the position in which the current value is displayed. -- -scaleGetValuePos :: ScaleClass s => s -> IO PositionType -scaleGetValuePos s = - liftM (toEnum.fromIntegral) $ {#call unsafe scale_get_value_pos#} (toScale s) +scaleGetValuePos :: ScaleClass self => self + -> IO PositionType -- ^ returns the position in which the current value is + -- displayed. +scaleGetValuePos self = + liftM (toEnum . fromIntegral) $ + {# call unsafe scale_get_value_pos #} + (toScale self) -------------------- -- Properties |
From: Duncan C. <dun...@us...> - 2005-03-14 23:55:19
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24514 Modified Files: ChangeLog Log Message: Documentation changes and code formatting changes. Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.381 retrieving revision 1.382 diff -u -d -r1.381 -r1.382 --- ChangeLog 14 Mar 2005 16:54:23 -0000 1.381 +++ ChangeLog 14 Mar 2005 23:55:05 -0000 1.382 @@ -4,6 +4,17 @@ confusion between pointer to rectangles and pointer to a pointer to rectangles. + * gtk/Graphics/UI/Gtk/Abstract/Bin.chs, + gtk/Graphics/UI/Gtk/Abstract/Box.chs, + gtk/Graphics/UI/Gtk/Abstract/ButtonBox.chs.pp, + gtk/Graphics/UI/Gtk/Abstract/Misc.chs, + gtk/Graphics/UI/Gtk/Abstract/Paned.chs.pp, + gtk/Graphics/UI/Gtk/Abstract/Range.chs, + gtk/Graphics/UI/Gtk/Abstract/Scale.chs, + gtk/Graphics/UI/Gtk/Abstract/Scrollbar.hs, + gtk/Graphics/UI/Gtk/Abstract/Separator.hs: documentation changes and + code formatting changes. + 2005-03-13 Duncan Coutts <du...@co...> * glib/System/Glib/Attributes.hs: new file defining Attr data type |
From: Duncan C. <dun...@us...> - 2005-03-14 16:55:04
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Gdk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5217/gtk/Graphics/UI/Gtk/Gdk Modified Files: Region.chs.pp Log Message: Segfault bug fix. Clear up confusion between pointer to rectangles and pointer to a pointer to rectangles. Index: Region.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Gdk/Region.chs.pp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Region.chs.pp 12 Feb 2005 17:19:22 -0000 1.2 +++ Region.chs.pp 14 Mar 2005 16:54:24 -0000 1.3 @@ -136,19 +136,19 @@ -- | Turn the 'Region' into its rectangles. -- --- * A 'Region' is a set of horizontal bands. Each band --- consists of one or more rectangles of the same height. No rectangles --- in a band touch. +-- A 'Region' is a set of horizontal bands. Each band consists of one or more +-- rectangles of the same height. No rectangles in a band touch. -- regionGetRectangles :: Region -> IO [Rectangle] -regionGetRectangles r = - alloca $ \(aPtr :: Ptr Rectangle) -> +regionGetRectangles region = + alloca $ \(rectPtrPtr :: Ptr (Ptr Rectangle)) -> alloca $ \(iPtr :: Ptr {#type gint#}) -> do - {#call unsafe region_get_rectangles#} r (castPtr aPtr) iPtr + {#call unsafe region_get_rectangles#} region (castPtr rectPtrPtr) iPtr size <- peek iPtr - regs <- peekArray (fromIntegral size) aPtr - {#call unsafe g_free#} (castPtr aPtr) - return regs + rectPtr <- peek rectPtrPtr + rects <- peekArray (fromIntegral size) rectPtr + {#call unsafe g_free#} (castPtr rectPtr) + return rects -- | Test if a 'Region' is empty. -- |
From: Duncan C. <dun...@us...> - 2005-03-14 16:54:51
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5217 Modified Files: ChangeLog Log Message: Segfault bug fix. Clear up confusion between pointer to rectangles and pointer to a pointer to rectangles. Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.380 retrieving revision 1.381 diff -u -d -r1.380 -r1.381 --- ChangeLog 13 Mar 2005 19:34:29 -0000 1.380 +++ ChangeLog 14 Mar 2005 16:54:23 -0000 1.381 @@ -1,3 +1,9 @@ +2005-03-14 Duncan Coutts <du...@co...> + + * gtk/Graphics/UI/Gtk/Gdk/Region.chs.pp: segfault bug fix. Clear up + confusion between pointer to rectangles and pointer to a pointer to + rectangles. + 2005-03-13 Duncan Coutts <du...@co...> * glib/System/Glib/Attributes.hs: new file defining Attr data type |
From: Duncan C. <dun...@us...> - 2005-03-13 19:35:18
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Multiline In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30354/gtk/Graphics/UI/Gtk/Multiline Modified Files: TextBuffer.chs TextMark.chs TextTag.chs.pp TextView.chs Log Message: Add properties. For the first round, just the easy properties that are implemented in terms of existing getter/setter functions and where there are no issues with NULL/Maybe types. Add Attributes file to glib package and modify Makefile.am accordingly. Index: TextView.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Multiline/TextView.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- TextView.chs 25 Feb 2005 22:53:42 -0000 1.4 +++ TextView.chs 13 Mar 2005 19:34:36 -0000 1.5 @@ -128,6 +128,19 @@ textViewGetIndent, textViewGetDefaultAttributes, +-- * Properties + textViewPixelsAboveLines, + textViewPixelsBelowLines, + textViewPixelsInsideWrap, + textViewEditable, + textViewWrapMode, + textViewJustification, + textViewLeftMargin, + textViewRightMargin, + textViewIndent, + textViewCursorVisible, + textViewBuffer, + -- * Signals onCopyClipboard, afterCopyClipboard, @@ -159,6 +172,7 @@ import System.Glib.FFI import System.Glib.UTFString +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) import System.Glib.GObject (makeNewGObject) {#import Graphics.UI.Gtk.Types#} @@ -731,6 +745,120 @@ >>= makeNewTextAttributes +-------------------- +-- Properties + +-- | Pixels of blank space above paragraphs. +-- +-- Allowed values: >= 0 +-- +-- Default value: 0 +-- +textViewPixelsAboveLines :: Attr TextView Int +textViewPixelsAboveLines = Attr + textViewGetPixelsAboveLines + textViewSetPixelsAboveLines + +-- | Pixels of blank space below paragraphs. +-- +-- Allowed values: >= 0 +-- +-- Default value: 0 +-- +textViewPixelsBelowLines :: Attr TextView Int +textViewPixelsBelowLines = Attr + textViewGetPixelsBelowLines + textViewSetPixelsBelowLines + +-- | Pixels of blank space between wrapped lines in a paragraph. +-- +-- Allowed values: >= 0 +-- +-- Default value: 0 +-- +textViewPixelsInsideWrap :: Attr TextView Int +textViewPixelsInsideWrap = Attr + textViewGetPixelsInsideWrap + textViewSetPixelsInsideWrap + +-- | Whether the text can be modified by the user. +-- +-- Default value: @True@ +-- +textViewEditable :: Attr TextView Bool +textViewEditable = Attr + textViewGetEditable + textViewSetEditable + +-- | Whether to wrap lines never, at word boundaries, or at character +-- boundaries. +-- +-- Default value: 'WrapNone' +-- +textViewWrapMode :: Attr TextView WrapMode +textViewWrapMode = Attr + textViewGetWrapMode + textViewSetWrapMode + +-- | Left, right, or center justification. +-- +-- Default value: 'JustifyLeft' +-- +textViewJustification :: Attr TextView Justification +textViewJustification = Attr + textViewGetJustification + textViewSetJustification + +-- | Width of the left margin in pixels. +-- +-- Allowed values: >= 0 +-- +-- Default value: 0 +-- +textViewLeftMargin :: Attr TextView Int +textViewLeftMargin = Attr + textViewGetLeftMargin + textViewSetLeftMargin + +-- | Width of the right margin in pixels. +-- +-- Allowed values: >= 0 +-- +-- Default value: 0 +-- +textViewRightMargin :: Attr TextView Int +textViewRightMargin = Attr + textViewGetRightMargin + textViewSetRightMargin + +-- | Amount to indent the paragraph, in pixels. +-- +-- Allowed values: >= 0 +-- +-- Default value: 0 +-- +textViewIndent :: Attr TextView Int +textViewIndent = Attr + textViewGetIndent + textViewSetIndent + +-- | If the insertion cursor is shown. +-- +-- Default value: @True@ +-- +textViewCursorVisible :: Attr TextView Bool +textViewCursorVisible = Attr + textViewGetCursorVisible + textViewSetCursorVisible + +-- | The buffer which is displayed. +-- +textViewBuffer :: Attr TextView TextBuffer +textViewBuffer = Attr + textViewGetBuffer + textViewSetBuffer + +-------------------- -- Signals -- | Copying to the clipboard. Index: TextMark.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Multiline/TextMark.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- TextMark.chs 25 Feb 2005 01:11:36 -0000 1.3 +++ TextMark.chs 13 Mar 2005 19:34:36 -0000 1.4 @@ -70,14 +70,18 @@ textMarkGetDeleted, textMarkGetName, textMarkGetBuffer, - textMarkGetLeftGravity + textMarkGetLeftGravity, + +-- * Properties + textMarkVisible ) where import Monad (liftM) import System.Glib.FFI import System.Glib.UTFString -import System.Glib.GObject (makeNewGObject) +import System.Glib.Attributes (Attr(..)) +import System.Glib.GObject (makeNewGObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -136,3 +140,12 @@ textMarkGetLeftGravity tm = liftM toBool $ {#call unsafe text_mark_get_left_gravity#} (toTextMark tm) +-------------------- +-- Properties + +-- | \'visible\' property. See 'textMarkGetVisible' and 'textMarkSetVisible' +-- +textMarkVisible :: Attr TextMark Bool +textMarkVisible = Attr + textMarkGetVisible + textMarkSetVisible Index: TextTag.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- TextTag.chs.pp 25 Feb 2005 22:53:42 -0000 1.4 +++ TextTag.chs.pp 13 Mar 2005 19:34:36 -0000 1.5 @@ -67,12 +67,16 @@ TextAttributes(..), textAttributesNew, makeNewTextAttributes, --internal + +-- * Properties + textTagPriority ) where import Monad (liftM) import System.Glib.FFI -import System.Glib.GObject (makeNewGObject) +import System.Glib.Attributes (Attr(..)) +import System.Glib.GObject (makeNewGObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -150,3 +154,13 @@ text_attributes_unref :: Ptr TextAttributes -> IO () #endif + +-------------------- +-- Properties + +-- | \'priority\' property. See 'textTagGetPriority' and 'textTagSetPriority' +-- +textTagPriority :: Attr TextTag Int +textTagPriority = Attr + textTagGetPriority + textTagSetPriority Index: TextBuffer.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- TextBuffer.chs 25 Feb 2005 22:53:42 -0000 1.4 +++ TextBuffer.chs 13 Mar 2005 19:34:35 -0000 1.5 @@ -130,6 +130,9 @@ textBufferBeginUserAction, textBufferEndUserAction, +-- * Properties + textBufferModified, + -- * Signals onApplyTag, afterApplyTag, @@ -160,6 +163,7 @@ import System.Glib.FFI import System.Glib.UTFString +import System.Glib.Attributes (Attr(..)) import System.Glib.GObject (makeNewGObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -601,6 +605,17 @@ toTextBuffer -------------------- +-- Properties + +-- | \'modified\' property. See 'textBufferGetModified' and +-- 'textBufferSetModified' +-- +textBufferModified :: Attr TextBuffer Bool +textBufferModified = Attr + textBufferGetModified + textBufferSetModified + +-------------------- -- Signals -- | A 'TextTag' was applied to a region of |
From: Duncan C. <dun...@us...> - 2005-03-13 19:35:18
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Ornaments In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30354/gtk/Graphics/UI/Gtk/Ornaments Modified Files: Frame.chs Log Message: Add properties. For the first round, just the easy properties that are implemented in terms of existing getter/setter functions and where there are no issues with NULL/Maybe types. Add Attributes file to glib package and modify Makefile.am accordingly. Index: Frame.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Ornaments/Frame.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Frame.chs 25 Feb 2005 01:11:36 -0000 1.3 +++ Frame.chs 13 Mar 2005 19:34:36 -0000 1.4 @@ -64,13 +64,18 @@ frameGetLabelAlign, ShadowType(..), frameSetShadowType, - frameGetShadowType + frameGetShadowType, + +-- * Properties + frameLabel, + frameShadowType ) where import Monad (liftM) import System.Glib.FFI import System.Glib.UTFString +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -153,6 +158,23 @@ "frameGetLabel: the title of the frame was not a Label widget." $ {#call unsafe frame_get_label#} (toFrame f) res <- peekUTFString strPtr - {#call unsafe g_free#} (castPtr strPtr) return res +-------------------- +-- Properties + +-- | Text of the frame's label. +-- +frameLabel :: Attr Frame String +frameLabel = Attr + frameGetLabel + frameSetLabel + +-- | Appearance of the frame border. +-- +-- Default value: 'ShadowEtchedIn' +-- +frameShadowType :: Attr Frame ShadowType +frameShadowType = Attr + frameGetShadowType + frameSetShadowType |
From: Duncan C. <dun...@us...> - 2005-03-13 19:35:17
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Layout In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30354/gtk/Graphics/UI/Gtk/Layout Modified Files: Expander.chs.pp Layout.chs Notebook.chs.pp Table.chs Log Message: Add properties. For the first round, just the easy properties that are implemented in terms of existing getter/setter functions and where there are no issues with NULL/Maybe types. Add Attributes file to glib package and modify Makefile.am accordingly. Index: Expander.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Layout/Expander.chs.pp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Expander.chs.pp 25 Feb 2005 22:53:41 -0000 1.4 +++ Expander.chs.pp 13 Mar 2005 19:34:34 -0000 1.5 @@ -74,6 +74,13 @@ expanderSetLabelWidget, expanderGetLabelWidget, +-- * Properties + expanderExpanded, + expanderUseUnderline, + expanderUseMarkup, + expanderSpacing, + expanderLabelWidget, + -- * Signals onActivate, afterActivate @@ -86,6 +93,7 @@ import System.Glib.FFI import System.Glib.UTFString +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object {#import Graphics.UI.Gtk.Types#} import Graphics.UI.Gtk.Signals @@ -162,6 +170,55 @@ {# call gtk_expander_get_label_widget #} expander -------------------- +-- Properties + +-- | Whether the expander has been opened to reveal the child widget. +-- +-- Default value: @False@ +-- +expanderExpanded :: Attr Expander Bool +expanderExpanded = Attr + expanderGetExpanded + expanderSetExpanded + +-- | If set, an underline in the text indicates the next character should be +-- used for the mnemonic accelerator key. +-- +-- Default value: @False@ +-- +expanderUseUnderline :: Attr Expander Bool +expanderUseUnderline = Attr + expanderGetUseUnderline + expanderSetUseUnderline + +-- | The text of the label includes XML markup. See pango_parse_markup(). +-- +-- Default value: @False@ +-- +expanderUseMarkup :: Attr Expander Bool +expanderUseMarkup = Attr + expanderGetUseMarkup + expanderSetUseMarkup + +-- | Space to put between the label and the child. +-- +-- Allowed values: >= 0 +-- +-- Default value: 0 +-- +expanderSpacing :: Attr Expander Int +expanderSpacing = Attr + expanderGetSpacing + expanderSetSpacing + +-- | A widget to display in place of the usual expander label. +-- +expanderLabelWidget :: Attr Expander Widget +expanderLabelWidget = Attr + expanderGetLabelWidget + expanderSetLabelWidget + +-------------------- -- Signals onActivate :: Expander -> IO () -> IO (ConnectId Expander) Index: Layout.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Layout/Layout.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Layout.chs 25 Feb 2005 01:11:34 -0000 1.3 +++ Layout.chs 13 Mar 2005 19:34:34 -0000 1.4 @@ -64,6 +64,10 @@ layoutSetHAdjustment, layoutSetVAdjustment, +-- * Properties + layoutHAdjustment, + layoutVAdjustment, + -- * Signals onSetScrollAdjustments, afterSetScrollAdjustments @@ -73,6 +77,7 @@ import Monad (liftM) import System.Glib.FFI +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -145,6 +150,23 @@ layoutSetVAdjustment l adj = {#call layout_set_vadjustment#} (toLayout l) adj -------------------- +-- Properties + +-- | The 'Adjustment' for the horizontal position. +-- +layoutHAdjustment :: Attr Layout Adjustment +layoutHAdjustment = Attr + layoutGetHAdjustment + layoutSetHAdjustment + +-- | The 'Adjustment' for the vertical position. +-- +layoutVAdjustment :: Attr Layout Adjustment +layoutVAdjustment = Attr + layoutGetVAdjustment + layoutSetVAdjustment + +-------------------- -- Signals -- | In case the adjustments are Index: Notebook.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Notebook.chs.pp 25 Feb 2005 01:11:34 -0000 1.3 +++ Notebook.chs.pp 13 Mar 2005 19:34:34 -0000 1.4 @@ -109,6 +109,13 @@ notebookSetTabLabel, notebookSetTabLabelText, +-- * Properties + notebookTabPos, + notebookShowTabs, + notebookShowBorder, + notebookScrollable, + notebookCurrentPage, + -- * Signals onSwitchPage, afterSwitchPage @@ -119,6 +126,7 @@ import System.Glib.FFI import System.Glib.UTFString +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -667,6 +675,53 @@ {#call notebook_set_tab_label_text#} (toNotebook nb) (toWidget child) labelPtr -------------------- +-- Properties + +-- | Which side of the notebook holds the tabs. +-- +-- Default value: 'PosTop' +-- +notebookTabPos :: Attr Notebook PositionType +notebookTabPos = Attr + notebookGetTabPos + notebookSetTabPos + +-- | Whether tabs should be shown or not. +-- +-- Default value: @True@ +-- +notebookShowTabs :: Attr Notebook Bool +notebookShowTabs = Attr + notebookGetShowTabs + notebookSetShowTabs + +-- | Whether the border should be shown or not. +-- +-- Default value: @True@ +-- +notebookShowBorder :: Attr Notebook Bool +notebookShowBorder = Attr + notebookGetShowBorder + notebookSetShowBorder + +-- | If @True@, scroll arrows are added if there are too many tabs to fit. +-- +-- Default value: @False@ +-- +notebookScrollable :: Attr Notebook Bool +notebookScrollable = Attr + notebookGetScrollable + notebookSetScrollable + +-- | \'currentPage\' property. See 'notebookGetCurrentPage' and +-- 'notebookSetCurrentPage' +-- +notebookCurrentPage :: Attr Notebook Int +notebookCurrentPage = Attr + notebookGetCurrentPage + notebookSetCurrentPage + +-------------------- -- Signals -- | This signal is emitted when a new page is Index: Table.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Layout/Table.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Table.chs 25 Feb 2005 01:11:34 -0000 1.3 +++ Table.chs 13 Mar 2005 19:34:34 -0000 1.4 @@ -80,12 +80,16 @@ tableSetColSpacings, tableGetDefaultColSpacing, tableSetHomogeneous, - tableGetHomogeneous + tableGetHomogeneous, + +-- * Properties + tableHomogeneous ) where import Monad (liftM) import System.Glib.FFI +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -206,3 +210,15 @@ tableGetHomogeneous :: TableClass tb => tb -> IO Bool tableGetHomogeneous tb = liftM toBool $ {#call unsafe table_get_homogeneous#} (toTable tb) + +-------------------- +-- Properties + +-- | If @True@ this means the table cells are all the same width\/height. +-- +-- Default value: @False@ +-- +tableHomogeneous :: Attr Table Bool +tableHomogeneous = Attr + tableGetHomogeneous + tableSetHomogeneous |
From: Duncan C. <dun...@us...> - 2005-03-13 19:35:17
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/MenuComboToolbar In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30354/gtk/Graphics/UI/Gtk/MenuComboToolbar Modified Files: CheckMenuItem.chs.pp ComboBoxEntry.chs.pp Menu.chs.pp MenuItem.chs ToolItem.chs.pp Toolbar.chs.pp Log Message: Add properties. For the first round, just the easy properties that are implemented in terms of existing getter/setter functions and where there are no issues with NULL/Maybe types. Add Attributes file to glib package and modify Makefile.am accordingly. Index: ComboBoxEntry.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/MenuComboToolbar/ComboBoxEntry.chs.pp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ComboBoxEntry.chs.pp 25 Feb 2005 22:53:41 -0000 1.4 +++ ComboBoxEntry.chs.pp 13 Mar 2005 19:34:35 -0000 1.5 @@ -59,15 +59,19 @@ -- * Methods comboBoxEntrySetTextColumn, comboBoxEntryGetTextColumn, + +-- * Properties + comboBoxEntryTextColumn #endif -) where + ) where #if GTK_CHECK_VERSION(2,4,0) import Monad (liftM) import System.Glib.FFI +import System.Glib.Attributes (Attr(..)) +import System.Glib.GObject (makeNewGObject) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) -import System.Glib.GObject (makeNewGObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -104,4 +108,17 @@ liftM fromIntegral $ {# call gtk_combo_box_entry_get_text_column #} (toComboBoxEntry combo) +-------------------- +-- Properties + +-- | A column in the data source model to get the strings from. +-- +-- Allowed values: >= -1 +-- +-- Default value: -1 +-- +comboBoxEntryTextColumn :: Attr ComboBoxEntry Int +comboBoxEntryTextColumn = Attr + comboBoxEntryGetTextColumn + comboBoxEntrySetTextColumn #endif Index: Menu.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/MenuComboToolbar/Menu.chs.pp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Menu.chs.pp 25 Feb 2005 01:11:34 -0000 1.3 +++ Menu.chs.pp 13 Mar 2005 19:34:35 -0000 1.4 @@ -96,6 +96,10 @@ #if GTK_CHECK_VERSION(2,4,0) menuSetMonitor, #endif + +-- * Properties + menuTearoffState, + menuAccelGroup, ) where import Monad (liftM) @@ -103,6 +107,7 @@ import System.Glib.FFI import System.Glib.UTFString +import System.Glib.Attributes (Attr(..)) import System.Glib.GObject (makeNewGObject) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} @@ -269,3 +274,20 @@ menuSetMonitor m monitorNum = {#call menu_set_monitor#} (toMenu m) (fromIntegral monitorNum) #endif + +-------------------- +-- Properties + +-- | +-- +menuTearoffState :: Attr Menu Bool +menuTearoffState = Attr + menuGetTearoffState + menuSetTearoffState + +-- | \'accelGroup\' property. See 'menuGetAccelGroup' and 'menuSetAccelGroup' +-- +menuAccelGroup :: Attr Menu AccelGroup +menuAccelGroup = Attr + menuGetAccelGroup + menuSetAccelGroup Index: ToolItem.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/MenuComboToolbar/ToolItem.chs.pp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ToolItem.chs.pp 25 Feb 2005 01:11:35 -0000 1.3 +++ ToolItem.chs.pp 13 Mar 2005 19:34:35 -0000 1.4 @@ -84,7 +84,15 @@ toolItemGetReliefStyle, toolItemRetrieveProxyMenuItem, toolItemGetProxyMenuItem, - toolItemSetProxyMenuItem + toolItemSetProxyMenuItem, + +-- * Properties + toolItemVisibleHorizontal, + toolItemVisibleVertical, + toolItemIsImportant, + toolItemExpand, + toolItemHomogeneous, + toolItemUseDragWindow #endif ) where @@ -94,6 +102,7 @@ import System.Glib.FFI import System.Glib.UTFString +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -275,4 +284,59 @@ {#call tool_item_set_proxy_menu_item#} (toToolItem item) strPtr (toWidget menuItem) +-------------------- +-- Properties + +-- | Whether the toolbar item is visible when the toolbar is in a horizontal +-- orientation. +-- +-- Default value: @True@ +-- +toolItemVisibleHorizontal :: Attr ToolItem Bool +toolItemVisibleHorizontal = Attr + toolItemGetVisibleHorizontal + toolItemSetVisibleHorizontal + +-- | Whether the toolbar item is visible when the toolbar is in a vertical +-- orientation. +-- +-- Default value: @True@ +-- +toolItemVisibleVertical :: Attr ToolItem Bool +toolItemVisibleVertical = Attr + toolItemGetVisibleVertical + toolItemSetVisibleVertical + +-- | Whether the toolbar item is considered important. When @True@, toolbar +-- buttons show text in 'ToolbarBothHoriz' mode. +-- +-- Default value: @False@ +-- +toolItemIsImportant :: Attr ToolItem Bool +toolItemIsImportant = Attr + toolItemGetIsImportant + toolItemSetIsImportant + +-- | \'expand\' property. See 'toolItemGetExpand' and 'toolItemSetExpand' +-- +toolItemExpand :: Attr ToolItem Bool +toolItemExpand = Attr + toolItemGetExpand + toolItemSetExpand + +-- | \'homogeneous\' property. See 'toolItemGetHomogeneous' and +-- 'toolItemSetHomogeneous' +-- +toolItemHomogeneous :: Attr ToolItem Bool +toolItemHomogeneous = Attr + toolItemGetHomogeneous + toolItemSetHomogeneous + +-- | \'useDragWindow\' property. See 'toolItemGetUseDragWindow' and +-- 'toolItemSetUseDragWindow' +-- +toolItemUseDragWindow :: Attr ToolItem Bool +toolItemUseDragWindow = Attr + toolItemGetUseDragWindow + toolItemSetUseDragWindow #endif Index: MenuItem.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/MenuComboToolbar/MenuItem.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- MenuItem.chs 25 Feb 2005 22:53:41 -0000 1.4 +++ MenuItem.chs 13 Mar 2005 19:34:35 -0000 1.5 @@ -90,6 +90,9 @@ onActivateItem, afterActivateItem, +-- * Properties + menuItemRightJustified, + -- * Signals onSelect, afterSelect, @@ -103,6 +106,7 @@ import System.Glib.FFI import System.Glib.UTFString +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -204,6 +208,17 @@ {#call menu_item_set_accel_path#} (toMenuItem mi) strPtr -------------------- +-- Properties + +-- | \'rightJustified\' property. See 'menuItemGetRightJustified' and +-- 'menuItemSetRightJustified' +-- +menuItemRightJustified :: Attr MenuItem Bool +menuItemRightJustified = Attr + menuItemGetRightJustified + menuItemSetRightJustified + +-------------------- -- Signals -- | The user has chosen the menu item and the item does not contain a submenu. Index: CheckMenuItem.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/MenuComboToolbar/CheckMenuItem.chs.pp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- CheckMenuItem.chs.pp 25 Feb 2005 22:53:41 -0000 1.4 +++ CheckMenuItem.chs.pp 13 Mar 2005 19:34:34 -0000 1.5 @@ -65,17 +65,23 @@ checkMenuItemGetActive, checkMenuItemToggled, checkMenuItemSetInconsistent, - checkMenuItemGetInconsistent + checkMenuItemGetInconsistent, #if GTK_CHECK_VERSION(2,4,0) - ,checkMenuItemGetDrawAsRadio, - checkMenuItemSetDrawAsRadio + checkMenuItemGetDrawAsRadio, + checkMenuItemSetDrawAsRadio, #endif + +-- * Properties + checkMenuItemActive, + checkMenuItemInconsistent, + checkMenuItemDrawAsRadio ) where import Monad (liftM) import System.Glib.FFI import System.Glib.UTFString +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -156,3 +162,32 @@ {#call unsafe check_menu_item_get_draw_as_radio#} (toCheckMenuItem mi) #endif +-------------------- +-- Properties + +-- | Whether the menu item is checked. +-- +-- Default value: @False@ +-- +checkMenuItemActive :: Attr CheckMenuItem Bool +checkMenuItemActive = Attr + checkMenuItemGetActive + checkMenuItemSetActive + +-- | Whether to display an \"inconsistent\" state. +-- +-- Default value: @False@ +-- +checkMenuItemInconsistent :: Attr CheckMenuItem Bool +checkMenuItemInconsistent = Attr + checkMenuItemGetInconsistent + checkMenuItemSetInconsistent + +-- | Whether the menu item looks like a radio menu item. +-- +-- Default value: @False@ +-- +checkMenuItemDrawAsRadio :: Attr CheckMenuItem Bool +checkMenuItemDrawAsRadio = Attr + checkMenuItemGetDrawAsRadio + checkMenuItemSetDrawAsRadio Index: Toolbar.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/MenuComboToolbar/Toolbar.chs.pp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Toolbar.chs.pp 25 Feb 2005 01:11:35 -0000 1.3 +++ Toolbar.chs.pp 13 Mar 2005 19:34:35 -0000 1.4 @@ -132,6 +132,14 @@ ReliefStyle(..), toolbarGetReliefStyle, #endif + +-- * Properties + toolbarOrientation, + toolbarShowArrow, + toolbarStyle, + toolbarTooltips, + +-- * Signals onOrientationChanged, afterOrientationChanged, onStyleChanged, @@ -145,6 +153,7 @@ import System.Glib.FFI import System.Glib.UTFString +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -506,6 +515,41 @@ #endif -------------------- +-- Properties + +-- | The orientation of the toolbar. +-- +-- Default value: 'OrientationHorizontal' +-- +toolbarOrientation :: Attr Toolbar Orientation +toolbarOrientation = Attr + toolbarGetOrientation + toolbarSetOrientation + +-- | If an arrow should be shown if the toolbar doesn't fit. +-- +-- Default value: @True@ +-- +toolbarShowArrow :: Attr Toolbar Bool +toolbarShowArrow = Attr + toolbarGetShowArrow + toolbarSetShowArrow + +-- | \'style\' property. See 'toolbarGetStyle' and 'toolbarSetStyle' +-- +toolbarStyle :: Attr Toolbar ToolbarStyle +toolbarStyle = Attr + toolbarGetStyle + toolbarSetStyle + +-- | \'tooltips\' property. See 'toolbarGetTooltips' and 'toolbarSetTooltips' +-- +toolbarTooltips :: Attr Toolbar Bool +toolbarTooltips = Attr + toolbarGetTooltips + toolbarSetTooltips + +-------------------- -- Signals -- | Emitted when toolbarSetOrientation is called. |
From: Duncan C. <dun...@us...> - 2005-03-13 19:35:17
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30354/gtk/Graphics/UI/Gtk/Misc Modified Files: EventBox.chs.pp HandleBox.chs SizeGroup.chs Viewport.chs Log Message: Add properties. For the first round, just the easy properties that are implemented in terms of existing getter/setter functions and where there are no issues with NULL/Maybe types. Add Attributes file to glib package and modify Makefile.am accordingly. Index: Viewport.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Misc/Viewport.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Viewport.chs 25 Feb 2005 01:11:35 -0000 1.3 +++ Viewport.chs 13 Mar 2005 19:34:35 -0000 1.4 @@ -64,12 +64,18 @@ viewportSetVAdjustment, ShadowType(..), viewportSetShadowType, - viewportGetShadowType + viewportGetShadowType, + +-- * Properties + viewportHAdjustment, + viewportVAdjustment, + viewportShadowType ) where import Monad (liftM) import System.Glib.FFI +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -129,5 +135,33 @@ {#call unsafe viewport_get_shadow_type#} (toViewport v) -------------------- +-- Properties + +-- | The 'Adjustment' that determines the values of the horizontal position +-- for this viewport. +-- +viewportHAdjustment :: Attr Viewport Adjustment +viewportHAdjustment = Attr + viewportGetHAdjustment + viewportSetHAdjustment + +-- | The 'Adjustment' that determines the values of the vertical position for +-- this viewport. +-- +viewportVAdjustment :: Attr Viewport Adjustment +viewportVAdjustment = Attr + viewportGetVAdjustment + viewportSetVAdjustment + +-- | Determines how the shadowed box around the viewport is drawn. +-- +-- Default value: 'ShadowIn' +-- +viewportShadowType :: Attr Viewport ShadowType +viewportShadowType = Attr + viewportGetShadowType + viewportSetShadowType + +-------------------- -- Signals Index: HandleBox.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Misc/HandleBox.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- HandleBox.chs 25 Feb 2005 01:11:35 -0000 1.3 +++ HandleBox.chs 13 Mar 2005 19:34:35 -0000 1.4 @@ -78,6 +78,11 @@ handleBoxSetSnapEdge, handleBoxGetSnapEdge, +-- * Properties + handleBoxShadowType, + handleBoxHandlePosition, + handleBoxSnapEdge, + -- * Signals onChildAttached, afterChildAttached, @@ -88,6 +93,7 @@ import Monad (liftM) import System.Glib.FFI +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -154,6 +160,37 @@ {#call unsafe handle_box_get_snap_edge#} (toHandleBox hb) -------------------- +-- Properties + +-- | Appearance of the shadow that surrounds the container. +-- +-- Default value: 'ShadowEtchedOut' +-- +handleBoxShadowType :: Attr HandleBox ShadowType +handleBoxShadowType = Attr + handleBoxGetShadowType + handleBoxSetShadowType + +-- | Position of the handle relative to the child widget. +-- +-- Default value: 'PosLeft' +-- +handleBoxHandlePosition :: Attr HandleBox PositionType +handleBoxHandlePosition = Attr + handleBoxGetHandlePosition + handleBoxSetHandlePosition + +-- | Side of the handlebox that's lined up with the docking point to dock the +-- handlebox. +-- +-- Default value: 'PosTop' +-- +handleBoxSnapEdge :: Attr HandleBox PositionType +handleBoxSnapEdge = Attr + handleBoxGetSnapEdge + handleBoxSetSnapEdge + +-------------------- -- Signals -- | Emitted when the contents of the handlebox @@ -175,4 +212,3 @@ onChildDetached = connect_NONE__NONE "child-detached" False afterChildDetached = connect_NONE__NONE "child-detached" True - Index: EventBox.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Misc/EventBox.chs.pp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- EventBox.chs.pp 25 Feb 2005 01:11:35 -0000 1.3 +++ EventBox.chs.pp 13 Mar 2005 19:34:35 -0000 1.4 @@ -58,13 +58,18 @@ ,eventBoxSetVisibleWindow, eventBoxGetVisibleWindow, eventBoxSetAboveChild, - eventBoxGetAboveChild + eventBoxGetAboveChild, + +-- * Properties + eventBoxVisibleWindow, + eventBoxAboveChild #endif ) where import Monad (liftM) import System.Glib.FFI +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -115,4 +120,21 @@ eventBoxGetAboveChild :: EventBox -> IO Bool eventBoxGetAboveChild ebox = liftM toBool $ {#call unsafe event_box_get_above_child#} ebox + +-------------------- +-- Properties + +-- | +-- +eventBoxVisibleWindow :: Attr EventBox Bool +eventBoxVisibleWindow = Attr + eventBoxGetVisibleWindow + eventBoxSetVisibleWindow + +-- | +-- +eventBoxAboveChild :: Attr EventBox Bool +eventBoxAboveChild = Attr + eventBoxGetAboveChild + eventBoxSetAboveChild #endif Index: SizeGroup.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Misc/SizeGroup.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- SizeGroup.chs 25 Feb 2005 22:53:41 -0000 1.4 +++ SizeGroup.chs 13 Mar 2005 19:34:35 -0000 1.5 @@ -74,13 +74,17 @@ sizeGroupSetMode, sizeGroupGetMode, sizeGroupAddWidget, - sizeGroupRemoveWidget + sizeGroupRemoveWidget, + +-- * Properties + sizeGroupMode ) where import Monad (liftM) import System.Glib.FFI -import System.Glib.GObject (makeNewGObject) +import System.Glib.Attributes (Attr(..)) +import System.Glib.GObject (makeNewGObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -132,3 +136,16 @@ sizeGroupSetMode :: SizeGroupClass obj => obj -> SizeGroupMode -> IO () sizeGroupSetMode obj mode = {#call size_group_set_mode#} (toSizeGroup obj) ((fromIntegral.fromEnum) mode) + +-------------------- +-- Properties + +-- | The directions in which the size group effects the requested sizes of its +-- component widgets. +-- +-- Default value: 'SizeGroupHorizontal' +-- +sizeGroupMode :: Attr SizeGroup SizeGroupMode +sizeGroupMode = Attr + sizeGroupGetMode + sizeGroupSetMode |
From: Duncan C. <dun...@us...> - 2005-03-13 19:35:14
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Entry In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30354/gtk/Graphics/UI/Gtk/Entry Modified Files: Editable.chs.pp Entry.chs.pp EntryCompletion.chs.pp SpinButton.chs Log Message: Add properties. For the first round, just the easy properties that are implemented in terms of existing getter/setter functions and where there are no issues with NULL/Maybe types. Add Attributes file to glib package and modify Makefile.am accordingly. Index: SpinButton.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Entry/SpinButton.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- SpinButton.chs 25 Feb 2005 22:53:42 -0000 1.4 +++ SpinButton.chs 13 Mar 2005 19:34:33 -0000 1.5 @@ -84,6 +84,15 @@ spinButtonGetSnapToTicks, spinButtonUpdate, +-- * Properties + spinButtonAdjustment, + spinButtonDigits, + spinButtonSnapToTicks, + spinButtonNumeric, + spinButtonWrap, + spinButtonUpdatePolicy, + spinButtonValue, + -- * Signals onInput, afterInput, @@ -96,6 +105,7 @@ import Monad (liftM) import System.Glib.FFI +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -293,6 +303,74 @@ spinButtonUpdate sb = {#call spin_button_update#} (toSpinButton sb) -------------------- +-- Properties + +-- | The adjustment that holds the value of the spinbutton. +-- +spinButtonAdjustment :: Attr SpinButton Adjustment +spinButtonAdjustment = Attr + spinButtonGetAdjustment + spinButtonSetAdjustment + +-- | The number of decimal places to display. +-- +-- Allowed values: \<= 20 +-- +-- Default value: 0 +-- +spinButtonDigits :: Attr SpinButton Int +spinButtonDigits = Attr + spinButtonGetDigits + spinButtonSetDigits + +-- | Whether erroneous values are automatically changed to a spin button's +-- nearest step increment. +-- +-- Default value: @False@ +-- +spinButtonSnapToTicks :: Attr SpinButton Bool +spinButtonSnapToTicks = Attr + spinButtonGetSnapToTicks + spinButtonSetSnapToTicks + +-- | Whether non-numeric characters should be ignored. +-- +-- Default value: @False@ +-- +spinButtonNumeric :: Attr SpinButton Bool +spinButtonNumeric = Attr + spinButtonGetNumeric + spinButtonSetNumeric + +-- | Whether a spin button should wrap upon reaching its limits. +-- +-- Default value: @False@ +-- +spinButtonWrap :: Attr SpinButton Bool +spinButtonWrap = Attr + spinButtonGetWrap + spinButtonSetWrap + +-- | Whether the spin button should update always, or only when the value is +-- legal. +-- +-- Default value: 'UpdateAlways' +-- +spinButtonUpdatePolicy :: Attr SpinButton SpinButtonUpdatePolicy +spinButtonUpdatePolicy = Attr + spinButtonGetUpdatePolicy + spinButtonSetUpdatePolicy + +-- | Reads the current value, or sets a new value. +-- +-- Default value: 0 +-- +spinButtonValue :: Attr SpinButton Double +spinButtonValue = Attr + spinButtonGetValue + spinButtonSetValue + +-------------------- -- Signals -- | Install a custom input handler. Index: Entry.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Entry/Entry.chs.pp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Entry.chs.pp 25 Feb 2005 22:53:42 -0000 1.4 +++ Entry.chs.pp 13 Mar 2005 19:34:33 -0000 1.5 @@ -82,6 +82,17 @@ entryGetCompletion, #endif +-- * Properties + entryMaxLength, + entryVisibility, + entryHasFrame, + entryInvisibleChar, + entryActivatesDefault, + entryWidthChars, + entryText, + entryAlignment, + entryCompletion, + -- * Signals onEntryActivate, afterEntryActivate, @@ -102,8 +113,9 @@ import System.Glib.FFI import System.Glib.UTFString +import System.Glib.Attributes (Attr(..)) +import System.Glib.GObject (makeNewGObject) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) -import System.Glib.GObject (makeNewGObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -274,6 +286,93 @@ #endif -------------------- +-- Properties + +-- | Maximum number of characters for this entry. Zero if no maximum. +-- +-- Allowed values: [0,65535] +-- +-- Default value: 0 +-- +entryMaxLength :: Attr Entry Int +entryMaxLength = Attr + entryGetMaxLength + entrySetMaxLength + +-- | @False@ displays the \"invisible char\" instead of the actual text +-- (password mode). +-- +-- Default value: @True@ +-- +entryVisibility :: Attr Entry Bool +entryVisibility = Attr + entryGetVisibility + entrySetVisibility + +-- | @False@ removes outside bevel from entry. +-- +-- Default value: @True@ +-- +entryHasFrame :: Attr Entry Bool +entryHasFrame = Attr + entryGetHasFrame + entrySetHasFrame + +-- | The character to use when masking entry contents (in \"password mode\"). +-- +-- Default value: \'*\' +-- +entryInvisibleChar :: Attr Entry Char +entryInvisibleChar = Attr + entryGetInvisibleChar + entrySetInvisibleChar + +-- | Whether to activate the default widget (such as the default button in a +-- dialog) when Enter is pressed. +-- +-- Default value: @False@ +-- +entryActivatesDefault :: Attr Entry Bool +entryActivatesDefault = Attr + entryGetActivatesDefault + entrySetActivatesDefault + +-- | Number of characters to leave space for in the entry. +-- +-- Allowed values: >= -1 +-- +-- Default value: -1 +-- +entryWidthChars :: Attr Entry Int +entryWidthChars = Attr + entryGetWidthChars + entrySetWidthChars + +-- | The contents of the entry. +-- +-- Default value: \"\" +-- +entryText :: Attr Entry String +entryText = Attr + entryGetText + entrySetText + +-- | \'alignment\' property. See 'entryGetAlignment' and 'entrySetAlignment' +-- +entryAlignment :: Attr Entry Float +entryAlignment = Attr + entryGetAlignment + entrySetAlignment + +-- | \'completion\' property. See 'entryGetCompletion' and +-- 'entrySetCompletion' +-- +entryCompletion :: Attr Entry EntryCompletion +entryCompletion = Attr + entryGetCompletion + entrySetCompletion + +-------------------- -- Signals -- | Emitted when the user presses return within Index: Editable.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Entry/Editable.chs.pp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Editable.chs.pp 25 Feb 2005 22:53:42 -0000 1.4 +++ Editable.chs.pp 13 Mar 2005 19:34:33 -0000 1.5 @@ -73,6 +73,10 @@ editableSetPosition, editableGetPosition, +-- * Properties + editablePosition, + editableEditable, + -- * Signals onEditableChanged, afterEditableChanged, @@ -84,6 +88,7 @@ import System.Glib.FFI import System.Glib.UTFString +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) import System.Glib.GObject (makeNewGObject) {#import Graphics.UI.Gtk.Types#} @@ -201,7 +206,25 @@ editableGetEditable :: EditableClass ed => ed -> IO Bool editableGetEditable ed = liftM toBool $ {#call editable_get_editable#} (toEditable ed) - + +-------------------- +-- Properties + +-- | \'position\' property. See 'editableGetPosition' and +-- 'editableSetPosition' +-- +editablePosition :: Attr Editable Int +editablePosition = Attr + editableGetPosition + editableSetPosition + +-- | \'editable\' property. See 'editableGetEditable' and +-- 'editableSetEditable' +-- +editableEditable :: Attr Editable Bool +editableEditable = Attr + editableGetEditable + editableSetEditable -------------------- -- Signals Index: EntryCompletion.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Entry/EntryCompletion.chs.pp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- EntryCompletion.chs.pp 27 Feb 2005 19:42:06 -0000 1.5 +++ EntryCompletion.chs.pp 13 Mar 2005 19:34:33 -0000 1.6 @@ -69,6 +69,7 @@ -- * Types EntryCompletion, EntryCompletionClass, + castToEntryCompletion, -- * Constructors entryCompletionNew, @@ -84,8 +85,11 @@ entryCompletionInsertActionText, entryCompletionInsertActionMarkup, entryCompletionDeleteAction, - entryCompletionSetTextColumn + entryCompletionSetTextColumn, #endif + +-- * Properties + entryCompletionMinimumKeyLength ) where #if GTK_CHECK_VERSION(2,4,0) @@ -95,6 +99,7 @@ import System.Glib.FFI import System.Glib.UTFString +import System.Glib.Attributes (Attr(..)) import System.Glib.GObject (makeNewGObject, mkFunPtrDestructor) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} @@ -195,4 +200,18 @@ dPtr <- mkFunPtrDestructor hPtr {# call gtk_entry_completion_set_match_func #} ec (castFunPtr hPtr) nullPtr dPtr + +-------------------- +-- Properties + +-- | Minimum length of the search key in order to look up matches. +-- +-- Allowed values: >= -1 +-- +-- Default value: 1 +-- +entryCompletionMinimumKeyLength :: Attr EntryCompletion Int +entryCompletionMinimumKeyLength = Attr + entryCompletionGetMinimumKeyLength + entryCompletionSetMinimumKeyLength #endif |
From: Duncan C. <dun...@us...> - 2005-03-13 19:35:13
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Buttons In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30354/gtk/Graphics/UI/Gtk/Buttons Modified Files: Button.chs.pp ToggleButton.chs Log Message: Add properties. For the first round, just the easy properties that are implemented in terms of existing getter/setter functions and where there are no issues with NULL/Maybe types. Add Attributes file to glib package and modify Makefile.am accordingly. Index: Button.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Buttons/Button.chs.pp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Button.chs.pp 25 Feb 2005 01:11:32 -0000 1.3 +++ Button.chs.pp 13 Mar 2005 19:34:32 -0000 1.4 @@ -85,6 +85,12 @@ buttonGetAlignment, #endif +-- * Properties + buttonUseUnderline, + buttonUseStock, + buttonFocusOnClick, + buttonRelief, + -- * Signals onButtonActivate, afterButtonActivate, @@ -104,6 +110,7 @@ import System.Glib.FFI import System.Glib.UTFString +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -119,7 +126,6 @@ buttonNew :: IO Button buttonNew = makeNewObject mkButton $ liftM castPtr {#call unsafe button_new#} - -- | Create a button with a label in it. -- buttonNewWithLabel :: String -> IO Button @@ -271,6 +277,47 @@ #endif -------------------- +-- Properties + +-- | If set, an underline in the text indicates the next character should be +-- used for the mnemonic accelerator key. +-- +-- Default value: @False@ +-- +buttonUseUnderline :: Attr Button Bool +buttonUseUnderline = Attr + buttonGetUseUnderline + buttonSetUseUnderline + +-- | If set, the label is used to pick a stock item instead of being +-- displayed. +-- +-- Default value: @False@ +-- +buttonUseStock :: Attr Button Bool +buttonUseStock = Attr + buttonGetUseStock + buttonSetUseStock + +-- | Whether the button grabs focus when it is clicked with the mouse. +-- +-- Default value: @True@ +-- +buttonFocusOnClick :: Attr Button Bool +buttonFocusOnClick = Attr + buttonGetFocusOnClick + buttonSetFocusOnClick + +-- | The border relief style. +-- +-- Default value: 'ReliefNormal' +-- +buttonRelief :: Attr Button ReliefStyle +buttonRelief = Attr + buttonGetRelief + buttonSetRelief + +-------------------- -- Signals -- | The button has been depressed (but not Index: ToggleButton.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Buttons/ToggleButton.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ToggleButton.chs 25 Feb 2005 01:11:32 -0000 1.3 +++ ToggleButton.chs 13 Mar 2005 19:34:32 -0000 1.4 @@ -75,6 +75,11 @@ toggleButtonGetInconsistent, toggleButtonSetInconsistent, +-- * Properties + toggleButtonActive, + toggleButtonInconsistent, + toggleButtonMode, + -- * Signals onToggled, afterToggled @@ -84,6 +89,7 @@ import System.Glib.FFI import System.Glib.UTFString +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -148,8 +154,8 @@ -- | Sets the state of the ToggleButton. True means the button should be -- depressed. -- -toggleButtonSetActive :: ToggleButtonClass tb => Bool -> tb -> IO () -toggleButtonSetActive active tb = +toggleButtonSetActive :: ToggleButtonClass tb => tb -> Bool -> IO () +toggleButtonSetActive tb active = {#call toggle_button_set_active#} (toToggleButton tb) (fromBool active) -- | Retrieve the inconsistent flag of the button. An inconsistent state only @@ -161,11 +167,39 @@ -- | Sets the inconsistent flag of the ToggleButton. -- -toggleButtonSetInconsistent :: ToggleButtonClass tb => Bool -> tb -> IO () -toggleButtonSetInconsistent incon tb = +toggleButtonSetInconsistent :: ToggleButtonClass tb => tb -> Bool -> IO () +toggleButtonSetInconsistent tb incon = {#call toggle_button_set_inconsistent#} (toToggleButton tb) (fromBool incon) -------------------- +-- Properties + +-- | If the toggle button should be pressed in or not. +-- +-- Default value: @False@ +-- +toggleButtonActive :: Attr ToggleButton Bool +toggleButtonActive = Attr + toggleButtonGetActive + toggleButtonSetActive + +-- | If the toggle button is in an \"in between\" state. +-- +-- Default value: @False@ +-- +toggleButtonInconsistent :: Attr ToggleButton Bool +toggleButtonInconsistent = Attr + toggleButtonGetInconsistent + toggleButtonSetInconsistent + +-- | \'mode\' property. See 'toggleButtonGetMode' and 'toggleButtonSetMode' +-- +toggleButtonMode :: Attr ToggleButton Bool +toggleButtonMode = Attr + toggleButtonGetMode + toggleButtonSetMode + +-------------------- -- Signals -- | Whenever the state of the button is changed, the toggled signal is emitted. |
From: Duncan C. <dun...@us...> - 2005-03-13 19:35:13
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Abstract In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30354/gtk/Graphics/UI/Gtk/Abstract Modified Files: Box.chs ButtonBox.chs.pp Paned.chs.pp Range.chs Scale.chs Widget.chs Log Message: Add properties. For the first round, just the easy properties that are implemented in terms of existing getter/setter functions and where there are no issues with NULL/Maybe types. Add Attributes file to glib package and modify Makefile.am accordingly. Index: Range.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Abstract/Range.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Range.chs 25 Feb 2005 22:53:41 -0000 1.4 +++ Range.chs 13 Mar 2005 19:34:32 -0000 1.5 @@ -66,6 +66,12 @@ rangeSetValue, rangeGetValue, +-- * Properties + rangeUpdatePolicy, + rangeAdjustment, + rangeInverted, + rangeValue, + -- * Signals onMoveSlider, afterMoveSlider @@ -74,6 +80,7 @@ import Monad (liftM) import System.Glib.FFI +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -160,6 +167,41 @@ {#call range_set_range#} (toRange r) (realToFrac min) (realToFrac max) -------------------- +-- Properties + +-- | How the range should be updated on the screen. +-- +-- Default value: 'UpdateContinuous' +-- +rangeUpdatePolicy :: Attr Range UpdateType +rangeUpdatePolicy = Attr + rangeGetUpdatePolicy + rangeSetUpdatePolicy + +-- | The 'Adjustment' that contains the current value of this range object. +-- +rangeAdjustment :: Attr Range Adjustment +rangeAdjustment = Attr + rangeGetAdjustment + rangeSetAdjustment + +-- | Invert direction slider moves to increase range value. +-- +-- Default value: @False@ +-- +rangeInverted :: Attr Range Bool +rangeInverted = Attr + rangeGetInverted + rangeSetInverted + +-- | \'value\' property. See 'rangeGetValue' and 'rangeSetValue' +-- +rangeValue :: Attr Range Double +rangeValue = Attr + rangeGetValue + rangeSetValue + +-------------------- -- Signals -- | The slide has moved. The arguments give Index: ButtonBox.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Abstract/ButtonBox.chs.pp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ButtonBox.chs.pp 25 Feb 2005 22:53:40 -0000 1.3 +++ ButtonBox.chs.pp 13 Mar 2005 19:34:32 -0000 1.4 @@ -70,13 +70,17 @@ buttonBoxSetLayout, buttonBoxSetChildSecondary, #if GTK_CHECK_VERSION(2,4,0) - buttonBoxGetChildSecondary + buttonBoxGetChildSecondary, #endif + +-- * Properties + buttonBoxLayout ) where import Monad (liftM) import System.Glib.FFI +import System.Glib.Attributes import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -126,3 +130,16 @@ buttonBoxSetChildSecondary b w s = {#call gtk_button_box_set_child_secondary #} (toButtonBox b) (toWidget w) (fromBool s) + +-------------------- +-- Properties + +-- | How to layout the buttons in the box. Possible values are default, +-- spread, edge, start and end. +-- +-- Default value: 'ButtonboxDefaultStyle' +-- +buttonBoxLayout :: Attr ButtonBox ButtonBoxStyle +buttonBoxLayout = Attr + buttonBoxGetLayout + buttonBoxSetLayout Index: Box.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Abstract/Box.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Box.chs 25 Feb 2005 22:53:40 -0000 1.4 +++ Box.chs 13 Mar 2005 19:34:31 -0000 1.5 @@ -104,12 +104,17 @@ boxSetSpacing, boxReorderChild, boxQueryChildPacking, - boxSetChildPacking + boxSetChildPacking, + +-- * Properties + boxSpacing, + boxHomogeneous ) where import Monad (liftM) import System.Glib.FFI +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -221,9 +226,31 @@ (toWidget w) (fromBool $ pack/=PackNatural) (fromBool $ pack==PackGrow) (fromIntegral pad) ((fromIntegral.fromEnum) pt) - -- | Retrieves the standard spacing between widgets. -- boxGetSpacing :: BoxClass b => b -> IO Int boxGetSpacing b = liftM fromIntegral $ {#call unsafe box_get_spacing#} (toBox b) + +-------------------- +-- Properties + +-- | The amount of space between children. +-- +-- Allowed values: >= 0 +-- +-- Default value: 0 +-- +boxSpacing :: Attr Box Int +boxSpacing = Attr + boxGetSpacing + boxSetSpacing + +-- | Whether the children should all be the same size. +-- +-- Default value: @False@ +-- +boxHomogeneous :: Attr Box Bool +boxHomogeneous = Attr + boxGetHomogeneous + boxSetHomogeneous Index: Widget.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Abstract/Widget.chs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Widget.chs 4 Mar 2005 22:10:44 -0000 1.5 +++ Widget.chs 13 Mar 2005 19:34:32 -0000 1.6 @@ -109,6 +109,10 @@ widgetSetDirection, -- General Setup. widgetGetDirection, +-- * Properties + widgetExtensionEvents, + widgetDirection, + -- * Signals Event(..), onButtonPress, @@ -186,8 +190,9 @@ import System.Glib.FFI import System.Glib.UTFString -import Graphics.UI.Gtk.Abstract.Object (makeNewObject) +import System.Glib.Attributes (Attr(..)) import System.Glib.GObject (makeNewGObject) +import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} import Graphics.UI.Gtk.Gdk.Enums @@ -396,6 +401,25 @@ {#call widget_get_direction#} (toWidget w) -------------------- +-- Properties + +-- | The mask that decides what kind of extension events this widget gets. +-- +-- Default value: 'ExtensionEventsNone' +-- +widgetExtensionEvents :: Attr Widget [ExtensionMode] +widgetExtensionEvents = Attr + widgetGetExtensionEvents + widgetSetExtensionEvents + +-- | \'direction\' property. See 'widgetGetDirection' and 'widgetSetDirection' +-- +widgetDirection :: Attr Widget TextDirection +widgetDirection = Attr + widgetGetDirection + widgetSetDirection + +-------------------- -- Signals -- Because there are so many similar signals (those that take an Event and Index: Paned.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Abstract/Paned.chs.pp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Paned.chs.pp 25 Feb 2005 22:53:41 -0000 1.4 +++ Paned.chs.pp 13 Mar 2005 19:34:32 -0000 1.5 @@ -76,16 +76,20 @@ panedPack1, panedPack2, panedSetPosition, - panedGetPosition + panedGetPosition, #if GTK_CHECK_VERSION(2,4,0) - ,panedGetChild1, - panedGetChild2 + panedGetChild1, + panedGetChild2, #endif + +-- * Properties + panedPosition ) where import Monad (liftM) import System.Glib.FFI +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -146,3 +150,18 @@ panedGetChild2 p = makeNewObject mkWidget $ {#call unsafe paned_get_child2#} (toPaned p) #endif + +-------------------- +-- Properties + +-- | Position of paned separator in pixels (0 means all the way to the +-- left\/top). +-- +-- Allowed values: >= 0 +-- +-- Default value: 0 +-- +panedPosition :: Attr Paned Int +panedPosition = Attr + panedGetPosition + panedSetPosition Index: Scale.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Abstract/Scale.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Scale.chs 25 Feb 2005 22:53:41 -0000 1.4 +++ Scale.chs 13 Mar 2005 19:34:32 -0000 1.5 @@ -64,12 +64,18 @@ scaleGetDrawValue, PositionType(..), scaleSetValuePos, - scaleGetValuePos + scaleGetValuePos, + +-- * Properties + scaleDigits, + scaleDrawValue, + scaleValuePos ) where import Monad (liftM) import System.Glib.FFI +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -116,3 +122,34 @@ scaleGetValuePos s = liftM (toEnum.fromIntegral) $ {#call unsafe scale_get_value_pos#} (toScale s) +-------------------- +-- Properties + +-- | The number of decimal places that are displayed in the value. +-- +-- Allowed values: [-1,64] +-- +-- Default value: 1 +-- +scaleDigits :: Attr Scale Int +scaleDigits = Attr + scaleGetDigits + scaleSetDigits + +-- | Whether the current value is displayed as a string next to the slider. +-- +-- Default value: @False@ +-- +scaleDrawValue :: Attr Scale Bool +scaleDrawValue = Attr + scaleGetDrawValue + scaleSetDrawValue + +-- | The position in which the current value is displayed. +-- +-- Default value: 'PosLeft' +-- +scaleValuePos :: Attr Scale PositionType +scaleValuePos = Attr + scaleGetValuePos + scaleSetValuePos |
From: Duncan C. <dun...@us...> - 2005-03-13 19:35:12
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Display In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30354/gtk/Graphics/UI/Gtk/Display Modified Files: Label.chs ProgressBar.chs Log Message: Add properties. For the first round, just the easy properties that are implemented in terms of existing getter/setter functions and where there are no issues with NULL/Maybe types. Add Attributes file to glib package and modify Makefile.am accordingly. Index: ProgressBar.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Display/ProgressBar.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ProgressBar.chs 25 Feb 2005 22:53:41 -0000 1.4 +++ ProgressBar.chs 13 Mar 2005 19:34:32 -0000 1.5 @@ -80,13 +80,19 @@ progressBarGetText, ProgressBarOrientation(..), progressBarSetOrientation, - progressBarGetOrientation + progressBarGetOrientation, + +-- * Properties + progressBarOrientation, + progressBarFraction, + progressBarPulseStep ) where import Monad (liftM) import System.Glib.FFI import System.Glib.UTFString +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -184,3 +190,36 @@ progressBarGetOrientation pb = liftM (toEnum.fromIntegral) $ {#call unsafe progress_bar_get_orientation#} (toProgressBar pb) +-------------------- +-- Properties + +-- | Orientation and growth direction of the progress bar. +-- +-- Default value: 'ProgressLeftToRight' +-- +progressBarOrientation :: Attr ProgressBar ProgressBarOrientation +progressBarOrientation = Attr + progressBarGetOrientation + progressBarSetOrientation + +-- | The fraction of total work that has been completed. +-- +-- Allowed values: [0,1] +-- +-- Default value: 0 +-- +progressBarFraction :: Attr ProgressBar Double +progressBarFraction = Attr + progressBarGetFraction + progressBarSetFraction + +-- | The fraction of total progress to move the bouncing block when pulsed. +-- +-- Allowed values: [0,1] +-- +-- Default value: 0.1 +-- +progressBarPulseStep :: Attr ProgressBar Double +progressBarPulseStep = Attr + progressBarGetPulseStep + progressBarSetPulseStep Index: Label.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Display/Label.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Label.chs 25 Feb 2005 22:53:41 -0000 1.4 +++ Label.chs 13 Mar 2005 19:34:32 -0000 1.5 @@ -148,14 +148,22 @@ labelGetSelectable, labelSelectRegion, labelGetSelectionBounds, - labelGetLayoutOffsets + labelGetLayoutOffsets, + +-- * Properties + labelUseMarkup, + labelUseUnderline, + labelJustify, + labelSelectable, + labelLineWrap ) where import Monad (liftM) import System.Glib.FFI import System.Glib.UTFString -import System.Glib.GObject (makeNewGObject) +import System.Glib.Attributes (Attr(..)) +import System.Glib.GObject (makeNewGObject) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -375,3 +383,52 @@ labelSetTextWithMnemonic l str = withUTFString str $ {#call label_set_text_with_mnemonic#} (toLabel l) + +-------------------- +-- Properties + +-- | The text of the label includes XML markup. See pango_parse_markup(). +-- +-- Default value: @False@ +-- +labelUseMarkup :: Attr Label Bool +labelUseMarkup = Attr + labelGetUseMarkup + labelSetUseMarkup + +-- | If set, an underline in the text indicates the next character should be +-- used for the mnemonic accelerator key. +-- +-- Default value: @False@ +-- +labelUseUnderline :: Attr Label Bool +labelUseUnderline = Attr + labelGetUseUnderline + labelSetUseUnderline + +-- | The alignment of the lines in the text of the label relative to each +-- other. This does NOT affect the alignment of the label within its +-- allocation. See 'Misc'::xalign for that. +-- +-- Default value: 'JustifyLeft' +-- +labelJustify :: Attr Label Justification +labelJustify = Attr + labelGetJustify + labelSetJustify + +-- | Whether the label text can be selected with the mouse. +-- +-- Default value: @False@ +-- +labelSelectable :: Attr Label Bool +labelSelectable = Attr + labelGetSelectable + labelSetSelectable + +-- | \'lineWrap\' property. See 'labelGetLineWrap' and 'labelSetLineWrap' +-- +labelLineWrap :: Attr Label Bool +labelLineWrap = Attr + labelGetLineWrap + labelSetLineWrap |
From: Duncan C. <dun...@us...> - 2005-03-13 19:35:11
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30354 Modified Files: ChangeLog Makefile.am Log Message: Add properties. For the first round, just the easy properties that are implemented in terms of existing getter/setter functions and where there are no issues with NULL/Maybe types. Add Attributes file to glib package and modify Makefile.am accordingly. Index: Makefile.am =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/Makefile.am,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- Makefile.am 4 Mar 2005 22:04:59 -0000 1.55 +++ Makefile.am 13 Mar 2005 19:34:29 -0000 1.56 @@ -237,6 +237,7 @@ glib/System/Glib/GParameter.hsc \ glib/System/Glib/StoreValue.hsc \ glib/System/Glib/GObject.chs.pp \ + glib/System/Glib/Attributes.hs \ glib/System/Glib/GError.chs.pp \ glib/System/Glib/GList.chs Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.379 retrieving revision 1.380 diff -u -d -r1.379 -r1.380 --- ChangeLog 6 Mar 2005 17:50:45 -0000 1.379 +++ ChangeLog 13 Mar 2005 19:34:29 -0000 1.380 @@ -1,3 +1,71 @@ +2005-03-13 Duncan Coutts <du...@co...> + + * glib/System/Glib/Attributes.hs: new file defining Attr data type + + * Makefile.am: add glib/System/Glib/Attributes.hs to glib sources list + + * gtk/Graphics/UI/Gtk/Abstract/Box.chs, + gtk/Graphics/UI/Gtk/Abstract/ButtonBox.chs.pp, + gtk/Graphics/UI/Gtk/Abstract/Paned.chs.pp, + gtk/Graphics/UI/Gtk/Abstract/Range.chs, + gtk/Graphics/UI/Gtk/Abstract/Scale.chs, + gtk/Graphics/UI/Gtk/Abstract/Widget.chs : add a few properties. + For the first round, just the easy properties that are implemented in + terms of existing getter/setter functions and where there are no + issues with NULL/Maybe types. + + * gtk/Graphics/UI/Gtk/Buttons/Button.chs.pp, + gtk/Graphics/UI/Gtk/Buttons/ToggleButton.chs: add properties. For + ToggleButton, change the argument order of toggleButtonSetActive and + toggleButtonSetInconsistent so they take the object first like every + other method and so that they match the type for an Attr. + + * gtk/Graphics/UI/Gtk/Display/Label.chs, + gtk/Graphics/UI/Gtk/Display/ProgressBar.chs: add properties. + + * gtk/Graphics/UI/Gtk/Entry/Editable.chs.pp, + gtk/Graphics/UI/Gtk/Entry/Entry.chs.pp, + gtk/Graphics/UI/Gtk/Entry/EntryCompletion.chs.pp, + gtk/Graphics/UI/Gtk/Entry/SpinButton.chs: add properties. + + * gtk/Graphics/UI/Gtk/Layout/Expander.chs.pp, + gtk/Graphics/UI/Gtk/Layout/Layout.chs, + gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp, + gtk/Graphics/UI/Gtk/Layout/Table.chs: add properties. + + * gtk/Graphics/UI/Gtk/MenuComboToolbar/CheckMenuItem.chs.pp, + gtk/Graphics/UI/Gtk/MenuComboToolbar/ComboBoxEntry.chs.pp, + gtk/Graphics/UI/Gtk/MenuComboToolbar/Menu.chs.pp, + gtk/Graphics/UI/Gtk/MenuComboToolbar/MenuItem.chs, + gtk/Graphics/UI/Gtk/MenuComboToolbar/ToolItem.chs.pp, + gtk/Graphics/UI/Gtk/MenuComboToolbar/Toolbar.chs.pp: add properties. + + * gtk/Graphics/UI/Gtk/Misc/EventBox.chs.pp, + gtk/Graphics/UI/Gtk/Misc/HandleBox.chs, + gtk/Graphics/UI/Gtk/Misc/SizeGroup.chs, + gtk/Graphics/UI/Gtk/Misc/Viewport.chs: add properties. + + * gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs, + gtk/Graphics/UI/Gtk/Multiline/TextMark.chs, + gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp, + gtk/Graphics/UI/Gtk/Multiline/TextView.chs: add properties. + + * gtk/Graphics/UI/Gtk/Ornaments/Frame.chs: add properties. + + * gtk/Graphics/UI/Gtk/Scrolling/ScrolledWindow.chs: add properties. + + * gtk/Graphics/UI/Gtk/Selectors/ColorSelection.chs, + gtk/Graphics/UI/Gtk/Selectors/FileChooser.chs.pp, + gtk/Graphics/UI/Gtk/Selectors/FontSelection.chs, + gtk/Graphics/UI/Gtk/Selectors/FontSelectionDialog.chs: add properties. + + * gtk/Graphics/UI/Gtk/TreeList/TreeSelection.chs.pp, + gtk/Graphics/UI/Gtk/TreeList/TreeView.chs.pp, + gtk/Graphics/UI/Gtk/TreeList/TreeViewColumn.chs.pp: add properties. + + * gtk/Graphics/UI/Gtk/Windows/Dialog.chs, + gtk/Graphics/UI/Gtk/Windows/Window.chs.pp: add properties. + 2005-03-06 Duncan Coutts <du...@co...> * tools/apiGen/CodeGen.hs: Prefix property names with their object. |
From: Duncan C. <dun...@us...> - 2005-03-13 19:35:07
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Selectors In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30354/gtk/Graphics/UI/Gtk/Selectors Modified Files: ColorSelection.chs FileChooser.chs.pp FontSelection.chs FontSelectionDialog.chs Log Message: Add properties. For the first round, just the easy properties that are implemented in terms of existing getter/setter functions and where there are no issues with NULL/Maybe types. Add Attributes file to glib package and modify Makefile.am accordingly. Index: FontSelection.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Selectors/FontSelection.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- FontSelection.chs 25 Feb 2005 01:11:37 -0000 1.3 +++ FontSelection.chs 13 Mar 2005 19:34:37 -0000 1.4 @@ -67,12 +67,16 @@ fontSelectionSetFontName, fontSelectionGetPreviewText, fontSelectionSetPreviewText, + +-- * Properties + fontSelectionPreviewText ) where import Monad (liftM) import System.Glib.FFI import System.Glib.UTFString +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -120,3 +124,15 @@ fontSelectionSetPreviewText obj text = withUTFString text $ \strPtr -> {#call font_selection_set_preview_text#} (toFontSelection obj) strPtr + +-------------------- +-- Properties + +-- | The text to display in order to demonstrate the selected font. +-- +-- Default value: \"abcdefghijk ABCDEFGHIJK\" +-- +fontSelectionPreviewText :: Attr FontSelection String +fontSelectionPreviewText = Attr + fontSelectionGetPreviewText + fontSelectionSetPreviewText Index: FontSelectionDialog.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Selectors/FontSelectionDialog.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- FontSelectionDialog.chs 25 Feb 2005 01:11:37 -0000 1.3 +++ FontSelectionDialog.chs 13 Mar 2005 19:34:37 -0000 1.4 @@ -66,12 +66,16 @@ fontSelectionDialogSetFontName, fontSelectionDialogGetPreviewText, fontSelectionDialogSetPreviewText, + +-- * Properties + fontSelectionDialogPreviewText, ) where import Monad (liftM) import System.Glib.FFI import System.Glib.UTFString +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -125,3 +129,14 @@ withUTFString text $ \strPtr -> {#call font_selection_dialog_set_preview_text#} (toFontSelectionDialog obj) strPtr + +-------------------- +-- Properties + +-- | \'previewText\' property. See 'fontSelectionDialogGetPreviewText' and +-- 'fontSelectionDialogSetPreviewText' +-- +fontSelectionDialogPreviewText :: Attr FontSelectionDialog String +fontSelectionDialogPreviewText = Attr + fontSelectionDialogGetPreviewText + fontSelectionDialogSetPreviewText Index: FileChooser.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Selectors/FileChooser.chs.pp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- FileChooser.chs.pp 25 Feb 2005 22:53:42 -0000 1.5 +++ FileChooser.chs.pp 13 Mar 2005 19:34:37 -0000 1.6 @@ -176,6 +176,13 @@ fileChooserRemoveShortcutFolderURI, fileChooserListShortcutFolderURIs, +-- * Properties + fileChooserUsePreviewLabel, + fileChooserSelectMultiple, + fileChooserPreviewWidgetActive, + fileChooserLocalOnly, + fileChooserAction, + -- * Signals onCurrentFolderChanged, afterCurrentFolderChanged, @@ -193,6 +200,7 @@ import Monad (liftM, when) import System.Glib.FFI +import System.Glib.Attributes (Attr(..)) import System.Glib.UTFString (readCString) {#import Graphics.UI.Gtk.Types#} import Graphics.UI.Gtk.Abstract.Object (makeNewObject) @@ -493,6 +501,49 @@ fromStringGSList strList -------------------- +-- Properties + +-- | \'usePreviewLabel\' property. See 'fileChooserGetUsePreviewLabel' and +-- 'fileChooserSetUsePreviewLabel' +-- +fileChooserUsePreviewLabel :: Attr FileChooser Bool +fileChooserUsePreviewLabel = Attr + fileChooserGetUsePreviewLabel + fileChooserSetUsePreviewLabel + +-- | \'selectMultiple\' property. See 'fileChooserGetSelectMultiple' and +-- 'fileChooserSetSelectMultiple' +-- +fileChooserSelectMultiple :: Attr FileChooser Bool +fileChooserSelectMultiple = Attr + fileChooserGetSelectMultiple + fileChooserSetSelectMultiple + +-- | \'previewWidgetActive\' property. See 'fileChooserGetPreviewWidgetActive' +-- and 'fileChooserSetPreviewWidgetActive' +-- +fileChooserPreviewWidgetActive :: Attr FileChooser Bool +fileChooserPreviewWidgetActive = Attr + fileChooserGetPreviewWidgetActive + fileChooserSetPreviewWidgetActive + +-- | \'localOnly\' property. See 'fileChooserGetLocalOnly' and +-- 'fileChooserSetLocalOnly' +-- +fileChooserLocalOnly :: Attr FileChooser Bool +fileChooserLocalOnly = Attr + fileChooserGetLocalOnly + fileChooserSetLocalOnly + +-- | \'action\' property. See 'fileChooserGetAction' and +-- 'fileChooserSetAction' +-- +fileChooserAction :: Attr FileChooser FileChooserAction +fileChooserAction = Attr + fileChooserGetAction + fileChooserSetAction + +-------------------- -- Signals onCurrentFolderChanged, afterCurrentFolderChanged :: FileChooserClass c => c -> IO () -> IO (ConnectId c) Index: ColorSelection.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Selectors/ColorSelection.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ColorSelection.chs 25 Feb 2005 22:53:42 -0000 1.4 +++ ColorSelection.chs 13 Mar 2005 19:34:37 -0000 1.5 @@ -67,12 +67,19 @@ colorSelectionSetPreviousAlpha, colorSelectionGetPreviousColor, colorSelectionSetPreviousColor, - colorSelectionIsAdjusting + colorSelectionIsAdjusting, + +-- * Properties + colorSelectionHasOpacityControl, + colorSelectionHasPalette, + colorSelectionCurrentAlpha, + colorSelectionPreviousAlpha ) where import Monad (liftM) import System.Glib.FFI +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -205,3 +212,43 @@ colorSelectionIsAdjusting :: ColorSelectionClass obj => obj -> IO Bool colorSelectionIsAdjusting obj = liftM toBool $ {#call unsafe color_selection_is_adjusting#} (toColorSelection obj) + +-------------------- +-- Properties + +-- | Whether the color selector should allow setting opacity. +-- +-- Default value: @False@ +-- +colorSelectionHasOpacityControl :: Attr ColorSelection Bool +colorSelectionHasOpacityControl = Attr + colorSelectionGetHasOpacityControl + colorSelectionSetHasOpacityControl + +-- | Whether a palette should be used. +-- +-- Default value: @False@ +-- +colorSelectionHasPalette :: Attr ColorSelection Bool +colorSelectionHasPalette = Attr + colorSelectionGetHasPalette + colorSelectionSetHasPalette + +-- | The current opacity value (0 fully transparent, 65535 fully opaque). +-- +-- Allowed values: \<= 65535 +-- +-- Default value: 65535 +-- +colorSelectionCurrentAlpha :: Attr ColorSelection Int +colorSelectionCurrentAlpha = Attr + colorSelectionGetCurrentAlpha + colorSelectionSetCurrentAlpha + +-- | \'previousAlpha\' property. See 'colorSelectionGetPreviousAlpha' and +-- 'colorSelectionSetPreviousAlpha' +-- +colorSelectionPreviousAlpha :: Attr ColorSelection Int +colorSelectionPreviousAlpha = Attr + colorSelectionGetPreviousAlpha + colorSelectionSetPreviousAlpha |
From: Duncan C. <dun...@us...> - 2005-03-13 19:34:54
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30354/gtk/Graphics/UI/Gtk/Windows Modified Files: Dialog.chs Window.chs.pp Log Message: Add properties. For the first round, just the easy properties that are implemented in terms of existing getter/setter functions and where there are no issues with NULL/Maybe types. Add Attributes file to glib package and modify Makefile.am accordingly. Index: Dialog.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Windows/Dialog.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Dialog.chs 25 Feb 2005 01:11:37 -0000 1.3 +++ Dialog.chs 13 Mar 2005 19:34:39 -0000 1.4 @@ -110,6 +110,9 @@ dialogSetHasSeparator, dialogSetResponseSensitive, +-- * Properties + dialogHasSeparator, + -- * Signals onResponse, afterResponse @@ -119,6 +122,7 @@ import System.Glib.FFI import System.Glib.UTFString +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -216,6 +220,18 @@ (fromBool sensitive) -------------------- +-- Properties + +-- | The dialog has a separator bar above its buttons. +-- +-- Default value: @True@ +-- +dialogHasSeparator :: Attr Dialog Bool +dialogHasSeparator = Attr + dialogGetHasSeparator + dialogSetHasSeparator + +-------------------- -- Signals -- | This signal is sent when a widget in the action Index: Window.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Windows/Window.chs.pp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Window.chs.pp 25 Feb 2005 01:11:37 -0000 1.3 +++ Window.chs.pp 13 Mar 2005 19:34:39 -0000 1.4 @@ -83,6 +83,9 @@ windowStick, windowUnstick, +-- * Properties + windowResizable, + -- * Signals onFrameEvent, afterFrameEvent, @@ -94,6 +97,7 @@ import System.Glib.FFI import System.Glib.UTFString +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.General.Enums (WindowType(WindowToplevel), WindowPosition(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} @@ -265,6 +269,18 @@ windowUnstick w = {#call window_unstick#} (toWindow w) -------------------- +-- Properties + +-- | If @True@, users can resize the window. +-- +-- Default value: @True@ +-- +windowResizable :: Attr Window Bool +windowResizable = Attr + windowGetResizable + windowSetResizable + +-------------------- -- Signals -- | |
From: Duncan C. <dun...@us...> - 2005-03-13 19:34:54
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/TreeList In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30354/gtk/Graphics/UI/Gtk/TreeList Modified Files: TreeSelection.chs.pp TreeView.chs.pp TreeViewColumn.chs.pp Log Message: Add properties. For the first round, just the easy properties that are implemented in terms of existing getter/setter functions and where there are no issues with NULL/Maybe types. Add Attributes file to glib package and modify Makefile.am accordingly. Index: TreeSelection.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/TreeList/TreeSelection.chs.pp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- TreeSelection.chs.pp 27 Feb 2005 19:42:06 -0000 1.3 +++ TreeSelection.chs.pp 13 Mar 2005 19:34:38 -0000 1.4 @@ -91,6 +91,9 @@ treeSelectionUnselectRange, #endif +-- * Properties + treeSelectionMode, + -- * Signals onSelectionChanged, afterSelectionChanged @@ -100,6 +103,7 @@ import System.Glib.FFI import System.Glib.GList (GList, fromGList, toGList) +import System.Glib.Attributes (Attr(..)) import System.Glib.GObject (mkFunPtrDestructor) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} @@ -327,6 +331,16 @@ #endif -------------------- +-- Properties + +-- | \'mode\' property. See 'treeSelectionGetMode' and 'treeSelectionSetMode' +-- +treeSelectionMode :: Attr TreeSelection SelectionMode +treeSelectionMode = Attr + treeSelectionGetMode + treeSelectionSetMode + +-------------------- -- Signals -- | Emitted each time the user changes the selection. Index: TreeView.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/TreeList/TreeView.chs.pp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- TreeView.chs.pp 27 Feb 2005 19:42:06 -0000 1.7 +++ TreeView.chs.pp 13 Mar 2005 19:34:38 -0000 1.8 @@ -145,6 +145,13 @@ treeViewSetSearchColumn, treeViewSetSearchEqualFunc, +-- * Properties + treeViewHeadersVisible, + treeViewReorderable, + treeViewRulesHint, + treeViewEnableSearch, + treeViewSearchColumn, + -- * Signals onColumnsChanged, afterColumnsChanged, @@ -170,6 +177,7 @@ import System.Glib.FFI import System.Glib.UTFString import System.Glib.GList (GList, fromGList) +import System.Glib.Attributes (Attr(..)) import System.Glib.GObject (makeNewGObject, mkFunPtrDestructor) import Graphics.UI.Gtk.General.Structs (Point, Rectangle) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) @@ -825,6 +833,56 @@ readNTP ptr = nativeTreePathGetIndices (NativeTreePath (castPtr ptr)) -------------------- +-- Properties + +-- | Show the column header buttons. +-- +-- Default value: @True@ +-- +treeViewHeadersVisible :: Attr TreeView Bool +treeViewHeadersVisible = Attr + treeViewGetHeadersVisible + treeViewSetHeadersVisible + +-- | View is reorderable. +-- +-- Default value: @False@ +-- +treeViewReorderable :: Attr TreeView Bool +treeViewReorderable = Attr + treeViewGetReorderable + treeViewSetReorderable + +-- | Set a hint to the theme engine to draw rows in alternating colors. +-- +-- Default value: @False@ +-- +treeViewRulesHint :: Attr TreeView Bool +treeViewRulesHint = Attr + treeViewGetRulesHint + treeViewSetRulesHint + +-- | View allows user to search through columns interactively. +-- +-- Default value: @True@ +-- +treeViewEnableSearch :: Attr TreeView Bool +treeViewEnableSearch = Attr + treeViewGetEnableSearch + treeViewSetEnableSearch + +-- | Model column to search through when searching through code. +-- +-- Allowed values: >= -1 +-- +-- Default value: -1 +-- +treeViewSearchColumn :: Attr TreeView Int +treeViewSearchColumn = Attr + treeViewGetSearchColumn + treeViewSetSearchColumn + +-------------------- -- Signals -- | The user has dragged a column to another Index: TreeViewColumn.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/TreeList/TreeViewColumn.chs.pp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- TreeViewColumn.chs.pp 25 Feb 2005 22:53:42 -0000 1.3 +++ TreeViewColumn.chs.pp 13 Mar 2005 19:34:38 -0000 1.4 @@ -109,6 +109,22 @@ treeViewColumnGetSortOrder, SortType(..), +-- * Properties + treeViewColumnVisible, + treeViewColumnResizable, + treeViewColumnSpacing, + treeViewColumnSizing, + treeViewColumnFixedWidth, + treeViewColumnMinWidth, + treeViewColumnMaxWidth, + treeViewColumnClickable, + treeViewColumnWidget, + treeViewColumnAlignment, + treeViewColumnReorderable, + treeViewColumnSortIndicator, + treeViewColumnSortOrder, + treeViewColumnSortColumnId, + -- * Signals onColClicked, afterColClicked @@ -118,13 +134,14 @@ import System.Glib.FFI import System.Glib.UTFString +{#import System.Glib.GList#} (fromGList) +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} import Graphics.UI.Gtk.General.Enums (TreeViewColumnSizing(..), SortType(..)) {#import Graphics.UI.Gtk.TreeList.TreeModel#} import Graphics.UI.Gtk.TreeList.CellRenderer (Attribute(..)) -{#import System.Glib.GList#} {# context lib="gtk" prefix="gtk" #} @@ -497,6 +514,142 @@ {#call unsafe tree_view_column_get_sort_order#} (toTreeViewColumn tvc) -------------------- +-- Properties + +-- | Whether to display the column. +-- +-- Default value: @True@ +-- +treeViewColumnVisible :: Attr TreeViewColumn Bool +treeViewColumnVisible = Attr + treeViewColumnGetVisible + treeViewColumnSetVisible + +-- | Column is user-resizable. +-- +-- Default value: @False@ +-- +treeViewColumnResizable :: Attr TreeViewColumn Bool +treeViewColumnResizable = Attr + treeViewColumnGetResizable + treeViewColumnSetResizable + +-- | Space which is inserted between cells. +-- +-- Allowed values: >= 0 +-- +-- Default value: 0 +-- +treeViewColumnSpacing :: Attr TreeViewColumn Int +treeViewColumnSpacing = Attr + treeViewColumnGetSpacing + treeViewColumnSetSpacing + +-- | Resize mode of the column. +-- +-- Default value: 'TreeViewColumnGrowOnly' +-- +treeViewColumnSizing :: Attr TreeViewColumn TreeViewColumnSizing +treeViewColumnSizing = Attr + treeViewColumnGetSizing + treeViewColumnSetSizing + +-- | Current fixed width of the column. +-- +-- Allowed values: >= 1 +-- +-- Default value: 1 +-- +treeViewColumnFixedWidth :: Attr TreeViewColumn Int +treeViewColumnFixedWidth = Attr + treeViewColumnGetFixedWidth + treeViewColumnSetFixedWidth + +-- | Minimum allowed width of the column. +-- +-- Allowed values: >= -1 +-- +-- Default value: -1 +-- +treeViewColumnMinWidth :: Attr TreeViewColumn Int +treeViewColumnMinWidth = Attr + treeViewColumnGetMinWidth + treeViewColumnSetMinWidth + +-- | Maximum allowed width of the column. +-- +-- Allowed values: >= -1 +-- +-- Default value: -1 +-- +treeViewColumnMaxWidth :: Attr TreeViewColumn Int +treeViewColumnMaxWidth = Attr + treeViewColumnGetMaxWidth + treeViewColumnSetMaxWidth + +-- | Whether the header can be clicked. +-- +-- Default value: @False@ +-- +treeViewColumnClickable :: Attr TreeViewColumn Bool +treeViewColumnClickable = Attr + treeViewColumnGetClickable + treeViewColumnSetClickable + +-- | Widget to put in column header button instead of column title. +-- +treeViewColumnWidget :: Attr TreeViewColumn Widget +treeViewColumnWidget = Attr + treeViewColumnGetWidget + treeViewColumnSetWidget + +-- | X Alignment of the column header text or widget. +-- +-- Allowed values: [0,1] +-- +-- Default value: 0 +-- +treeViewColumnAlignment :: Attr TreeViewColumn Float +treeViewColumnAlignment = Attr + treeViewColumnGetAlignment + treeViewColumnSetAlignment + +-- | Whether the column can be reordered around the headers. +-- +-- Default value: @False@ +-- +treeViewColumnReorderable :: Attr TreeViewColumn Bool +treeViewColumnReorderable = Attr + treeViewColumnGetReorderable + treeViewColumnSetReorderable + +-- | Whether to show a sort indicator. +-- +-- Default value: @False@ +-- +treeViewColumnSortIndicator :: Attr TreeViewColumn Bool +treeViewColumnSortIndicator = Attr + treeViewColumnGetSortIndicator + treeViewColumnSetSortIndicator + +-- | Sort direction the sort indicator should indicate. +-- +-- Default value: 'SortAscending' +-- +treeViewColumnSortOrder :: Attr TreeViewColumn SortType +treeViewColumnSortOrder = Attr + treeViewColumnGetSortOrder + treeViewColumnSetSortOrder + +-- | \'sortColumnId\' property. See 'treeViewColumnGetSortColumnId' and +-- 'treeViewColumnSetSortColumnId' +-- +treeViewColumnSortColumnId :: Attr TreeViewColumn Int +treeViewColumnSortColumnId = Attr + treeViewColumnGetSortColumnId + treeViewColumnSetSortColumnId + +-------------------- -- Signals -- | Emitted when the header of this column has been |