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 |