From: Axel S. <A....@ke...> - 2007-07-16 10:33:32
|
Sun Jul 15 09:22:32 PDT 2007 A....@ke... * Add columns to our Haskell tree model. This patch adds the ability to lookup values from TreeStore and ListStore in terms of columns. Some information in e.g. ComboBox have properties that are not shown by CellRenderers directly. These properties can therefore not be set by using function in CellLayout and the only way to connect them to the model is by pretending they access a certain column in the model. Hence this patch adds the ability to access a Haskell model using a column number. The idea is that these column numbers are opaque to the user of Gtk2Hs. Functions that use columns are called widgetSetBlahSource where wiget is the widget and Blah is the property. move ./gtk/Graphics/UI/Gtk/ModelView/CellRendererToggle.chs ./gtk/Graphics/UI/Gtk/ModelView/CellRendererToggle.chs.pp hunk ./Makefile.am 527 - gtk/Graphics/UI/Gtk/ModelView/CellRendererToggle.chs \ + gtk/Graphics/UI/Gtk/ModelView/CellRendererToggle.chs.pp \ hunk ./glib/System/Glib/GValueTypes.chs 58 + valueSetMaybeGObject, hunk ./glib/System/Glib/GValueTypes.chs 203 +valueSetMaybeGObject :: GObjectClass gobj => GValue -> (Maybe gobj) -> IO () +valueSetMaybeGObject gvalue (Just obj) = valueSetGObject gvalue obj +valueSetMaybeGObject gvalue Nothing = + {# call unsafe g_value_set_object #} gvalue nullPtr + hunk ./glib/System/Glib/Properties.chs 63 + readAttrFromBoolProperty, hunk ./glib/System/Glib/Properties.chs 229 +readAttrFromBoolProperty :: GObjectClass gobj => String -> ReadAttr gobj Bool +readAttrFromBoolProperty propName = + readAttr (objectGetPropertyBool propName) + hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRenderer.chs.pp 25 --- A 'CellRenderer' is an object that determines how the cell of a --- 'TreeView' widget is displayed. [_$_] +-- An object for rendering a cell in a list, icon or combo box widget. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRenderer.chs.pp 27 --- * Each 'TreeViewColumn' has one or more accociated 'CellRenderer's. --- The data supply for a cell is contained in a 'TreeStore' or a --- 'ListStore' (both subclasses of 'TreeModel'). Each 'CellRenderer' --- may have several attributes. Each attribute is associated with [_$_] --- one column of the 'TreeModel' database. Thus, several columns of a [_$_] --- 'TreeModel' may be the supply for one 'TreeViewColumn'. --- - hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRenderer.chs.pp 29 --- [_$_] +--[_^I_] [_$_] hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRenderer.chs.pp 37 --- cells on the screen. To this extent, it isn't expected that a CellRenderer --- keep any permanent state around. Instead, any state is set just prior to use --- by changing the 'System.Glib.Attributes'. Then, the cell is measured and rendered --- in the correct location +-- cells on the screen. To this extent, it isn't expected that a +-- 'CellRenderer' keep any permanent state around. Instead, any state is set +-- just prior to use by changing the attributes of the cell. Then, the cell is +-- measured and rendered in the correct location. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRenderer.chs.pp 44 --- 'CellRendererToggle', which toggles when it gets activated by a mouse click, --- or it can be editable like 'CellRendererText', which allows the user to edit --- the text using a 'Entry'. +-- 'Graphics.UI.Gtk.ModelView.CellRendererToggle', which toggles when it gets +-- activated by a mouse click, or it can be editable like +-- 'Graphics.UI.Gtk.ModelView.CellRendererText', which allows the user to edit +-- the text using a 'Graphics.UI.Gtk.Entry.Entry'. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRenderer.chs.pp 67 + CellRendererMode, + +-- * Methods +#if GTK_CHECK_VERSION(2,6,0) + cellRendererStopEditing, +#endif + cellRendererGetFixedSize, + cellRendererSetFixedSize, hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRenderer.chs.pp 92 -#if GTK_CHECK_VERSION(2,4,0) hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRenderer.chs.pp 93 +#if GTK_CHECK_VERSION(2,6,0) + editingStarted, +#endif +#if GTK_CHECK_VERSION(2,4,0) + editingCanceled, +#endif + +-- * Deprecated +#ifndef DISABLE_DEPRECATED +#if GTK_CHECK_VERSION(2,6,0) hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRenderer.chs.pp 104 - afterEditingStarted + afterEditingStarted, +#endif +#if GTK_CHECK_VERSION(2,4,0) + onEditingCanceled, + afterEditingCanceled, +#endif hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRenderer.chs.pp 125 + +#if GTK_CHECK_VERSION(2,6,0) +-- %hash c:75b3 d:45ca +-- | Informs the cell renderer that the editing is stopped. If @canceled@ is +-- @True@, the cell renderer will emit the 'editingCanceled' signal. +-- +-- * Available since Gtk+ version 2.6 +-- +cellRendererStopEditing :: CellRendererClass self => self + -> Bool -- ^ @canceled@ - @True@ if the editing has been canceled + -> IO () +cellRendererStopEditing self canceled = + {# call gtk_cell_renderer_stop_editing #} + (toCellRenderer self) + (fromBool canceled) +#endif + +-- %hash c:6d51 d:dc3e +-- | Returns @(width, height)@ denoting the size of the fixed size of +-- @cell@. If no fixed size is set, returns @-1@ for that value. +-- +cellRendererGetFixedSize :: CellRendererClass self => self + -> IO (Int, Int) -- ^ @(width, height)@ +cellRendererGetFixedSize self = + alloca $ \widthPtr -> + alloca $ \heightPtr -> + {# call gtk_cell_renderer_get_fixed_size #} + (toCellRenderer self) + widthPtr + heightPtr >> + peek widthPtr >>= \width -> + peek heightPtr >>= \height -> + return (fromIntegral width, fromIntegral height) + +-- %hash c:85dc d:5fd4 +-- | Sets the renderer size to be explicit, independent of the properties set. +-- +cellRendererSetFixedSize :: CellRendererClass self => self + -> Int -- ^ @width@ - the width of the cell renderer, or -1 + -> Int -- ^ @height@ - the height of the cell renderer, or -1 + -> IO () +cellRendererSetFixedSize self width height = + {# call gtk_cell_renderer_set_fixed_size #} + (toCellRenderer self) + (fromIntegral width) + (fromIntegral height) + hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRenderer.chs.pp 283 + +-------------------- +-- Signals + hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRenderer.chs.pp 288 --- | This signal gets emitted when a cell starts to be edited. +-- %hash c:eff4 d:fc12 +-- | This signal gets emitted when the user cancels the process of editing a +-- cell. For example, an editable cell renderer could be written to cancel +-- editing when the user presses Escape. +-- +-- * Available since Gtk+ version 2.4 +-- +editingCanceled :: CellRendererClass self => Signal self (IO ()) +editingCanceled = Signal (connect_NONE__NONE "editing-canceled") + +#if GTK_CHECK_VERSION(2,6,0) +-- %hash c:41f0 d:49f +-- | This signal gets emitted when a cell starts to be edited. The indended +-- use of this signal is to do special setup on @editable@, e.g. adding a +-- 'EntryCompletion' or setting up additional columns in a 'ComboBox'. +-- +-- * The widget that is passed to the handler contains the widget that is used +-- by the 'CellRenderer' to interact with the user. The widget must be +-- casted to the appropriate widget. For instance, a +-- 'Graphics.UI.Gtk.ModelView.CellRendererText' uses an +-- 'Graphics.UI.Gtk.Entry.Entry' widget, while a +-- 'Graphics.UI.Gtk.ModelView.CellRendererCombo' uses a +-- 'Graphics.UI.Gtk.ModelView.ComboBox.ComboBox' (if +-- 'Graphics.UI.Gtk.ModelView.CellRendererCombo.cellComboHasEntry' is +-- @False@) or a 'Graphics.UI.Gtk.ModelView.ComboBoxEntry.ComboBoxEntry' (if +-- 'Graphics.UI.Gtk.ModelView.CellRendererCombo.cellComboHasEntry' is +-- @True@). hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRenderer.chs.pp 316 --- * The indended --- use of this signal is to do special setup on the widget that is created --- to allow the editing process. For example, the 'CellRendererText' uses --- an 'Entry' widget which has an 'EntryCompletion' interface. On reception --- of this signal, the program can set the model from which to retrieve the --- completions. +-- * Available since Gtk+ version 2.6 hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRenderer.chs.pp 318 -onEditingStarted, afterEditingStarted :: CellRendererClass self => self - -> (CellEditable -> TreePath -> IO ()) +editingStarted :: CellRendererClass self => + Signal self (Widget -> TreePath -> IO ()) +editingStarted = Signal editingStartedInternal + +editingStartedInternal after cr act = + connect_OBJECT_STRING__NONE "editing-started" after cr + $ \ce path -> act ce (stringToTreePath path) +#endif +#endif + +-------------------- +-- Deprecated Signals + +#ifndef DISABLE_DEPRECATED + +#if GTK_CHECK_VERSION(2,4,0) +-- %hash c:b10f +onEditingCanceled :: CellRendererClass self => self + -> IO () hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRenderer.chs.pp 338 -onEditingStarted cr act = - connect_OBJECT_STRING__NONE "editing-started" False cr - $ \ce path -> act ce (stringToTreePath path) -afterEditingStarted cr act = - connect_OBJECT_STRING__NONE "editing-started" True cr - $ \ce path -> act ce (stringToTreePath path) +onEditingCanceled = connect_NONE__NONE "editing-canceled" False +{-# DEPRECATED onEditingCanceled "instead of 'onEditingCanceled obj' use 'on obj editingCanceled'" #-} + +-- %hash c:808e +afterEditingCanceled :: CellRendererClass self => self + -> IO () + -> IO (ConnectId self) +afterEditingCanceled = connect_NONE__NONE "editing-canceled" True +{-# DEPRECATED afterEditingCanceled "instead of 'afterEditingCanceled obj' use 'after obj editingCanceled'" #-} + +#if GTK_CHECK_VERSION(2,6,0) +-- %hash c:6d9c +onEditingStarted :: CellRendererClass self => self + -> (Widget -> TreePath -> IO ()) + -> IO (ConnectId self) +onEditingStarted = editingStartedInternal False +{-# DEPRECATED onEditingStarted "instead of 'onEditingStarted obj' use 'on obj editingStarted'" #-} + +-- %hash c:ef1b +afterEditingStarted :: CellRendererClass self => self + -> (Widget -> TreePath -> IO ()) + -> IO (ConnectId self) +afterEditingStarted = editingStartedInternal True +{-# DEPRECATED afterEditingStarted "instead of 'afterEditingStarted obj' use 'after obj editingStarted'" #-} +#endif +#endif hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererCombo.chs.pp 31 --- [_$_] --- | 'CellRendererCombo' renders text in a cell like 'CellRendererText' from --- which it is derived. But while 'CellRendererText' offers a simple entry to --- edit the text, 'CellRendererCombo' offers a 'ComboBox' or 'ComboBoxEntry' --- widget to edit the text. The values to display in the combo box are taken --- from the tree model specified in the model property. +--[_^I_] [_$_] +-- | 'CellRendererCombo' renders text in a cell like +-- 'Graphics.UI.Gtk.ModelView.CellRendererText' from which it is derived. But +-- while 'Graphics.UI.Gtk.ModelView.CellRendererText' offers a simple entry to +-- edit the text, 'CellRendererCombo' offers a +-- 'Graphics.UI.Gtk.ModelView.ComboBox' or +-- 'Graphics.UI.Gtk.ModelView.ComboBoxEntry' widget to edit the text. The +-- values to display in the combo box are taken from the tree model specified +-- in the model property. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererCombo.chs.pp 42 --- combo box and sets it to display the column specified by its text-column --- property. Further cell renderers can be added in a handler for the --- editing-started signal. +-- combo box and sets it to display the column specified by its +-- 'cellTextModel' property. Further cell renderers can be added in a handler +-- for the 'Graphics.UI.Gtk.ModelView.CellRenderer.editingStarted' signal. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererCombo.chs.pp 62 + TextModel, hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererCombo.chs.pp 66 + textModelNew, + +-- * Methods + textModelGetModel, hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererCombo.chs.pp 73 - + cellComboTextModel hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererCombo.chs.pp 80 -import System.Glib.Attributes (Attr) +import System.Glib.Attributes (Attr, WriteAttr, writeAttr) hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererCombo.chs.pp 86 +{#import Graphics.UI.Gtk.ModelView.Types#} +{#import Graphics.UI.Gtk.ModelView.CustomStore#} hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererCombo.chs.pp 96 --- a fixed set of options the user can choose from, or, using --- 'cellComboHasEntry', allows the user to add new elements. [_$_] +-- a fixed set of options the user can choose from. [_$_] hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererCombo.chs.pp 100 - ren <- makeNewObject mkCellRendererCombo $ + makeNewObject mkCellRendererCombo $ hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererCombo.chs.pp 103 - -- Create a fake model with one string column in it. The model itself is - -- never used. - mod <- constructNewGObject mkListStore $ - withArray [fromIntegral (fromEnum TMstring)] $ \typesArr -> - {# call unsafe list_store_newv #} 1 typesArr - objectSetPropertyGObject {# call pure unsafe gtk_tree_model_get_type #} - "model" ren mod - objectSetPropertyInt "text-column" ren 0 [_$_] - return ren + + +-- | An opaque value containing a tree model and a function extracting +-- a string from it. This value is used to set the 'cellComboTextModel' +-- property. +data TreeModelClass model => TextModel model = TextModel model ColumnId + +-- Implementation note: it seems from the API that it might be possible to set +-- the model and the attributes of the combo box when the 'editingStarted' +-- signal of the 'CellRenderer'. However, this is not possible since the +-- 'CellRendererCombo' subbornly refuses to populate the cell with a combox +-- box if either the model or the text-column isn't set. Thus, unfortunately, +-- we always need to have a text in the combo box, even though it would be +-- perfectly reasonable to have, say, only icons. As a result of this stupid +-- behaviour, it is necessary to use the clumsy 'TextModel' machinery. +[_^I_][_$_] +-- | Create an opaque value containing a tree model and a function extracting +-- a string from it. This value is used to set the 'cellComboTextModel' +-- property. +-- +textModelNew :: (TreeModelClass (model row), + TypedTreeModelClass model) + => model row -- ^ the model which is to be used to fill the + -- 'CellRendererCombo' + -> (row -> String) -- ^ a function to extract + -> IO (TextModel (model row)) +textModelNew model extract = do + col <- treeModelUpdateColumn model (-1) (CAString extract) + return (TextModel model col) + +-- | Extact the model from the 'TextModel' value. +textModelGetModel :: TreeModelClass model => TextModel model -> model +textModelGetModel (TextModel m _) = m + hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererCombo.chs.pp 149 +-- | The 'TextModel', that is, a tree model with a function that extracts a +-- string from which the options of the combo box are drawn. Note that this +-- tree model can be a datum in the tree model that is used to populate the +-- view in which the 'CellRendererCombo' is part of. In other words, it is +-- possible that every 'CellRendererCombo' can show a different set of options +-- on each row. [_$_] +-- +cellComboTextModel :: ( TreeModelClass model, + CellRendererComboClass self) => + WriteAttr self (TextModel model) +cellComboTextModel = writeAttr $ \cr (TextModel model row) -> do + objectSetPropertyInt "text-column" cr row + objectSetPropertyGObject {# call fun unsafe gtk_tree_model_get_type #} + "model" cr model + hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererPixbuf.chs.pp 31 --- allows to render either a given 'Pixbuf' (set via the pixbuf property) or a --- stock icon (set via the stock-id property). +-- allows to render either a given 'Pixbuf' (set via the 'cellPixbuf' +-- property) or a stock icon (set via the 'cellPixbufStockId' property). hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererPixbuf.chs.pp 34 --- To support the tree view, 'CellRendererPixbuf' also supports rendering --- two alternative pixbufs, when the is-expander property is @True@. If the --- is-expanded property is @True@ and the pixbuf-expander-open property is set --- to a pixbuf, it renders that pixbuf, if the is-expanded property is @False@ --- and the pixbuf-expander-closed property is set to a pixbuf, it renders that --- one. +-- To support the tree view, 'CellRendererPixbuf' also supports rendering two +-- alternative pixbufs, when the +-- 'Graphics.UI.Gtk.ModelView.CellRenderer.cellIsExpander' property is @True@. +-- If the this property is @True@ and the 'cellPixbufExpanderOpen' property is +-- set to a pixbuf, it renders that pixbuf, if the +-- 'Graphics.UI.Gtk.ModelView.CellRenderer.cellIsExpanded' property is @False@ +-- and the 'cellPixbufExpanderClosed' property is set to a pixbuf, it renders +-- that one. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererPixbuf.chs.pp 60 + hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererProgress.chs.pp 30 +-- * Detail +-- +-- | 'CellRendererProgress' renders a numeric value as a progress par in a +-- cell. Additionally, it can display a text on top of the progress bar. +-- hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 36 --- + hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 60 + cellText, + cellTextMarkup, + --cellTextAttributes, + cellTextSingleParagraphMode, hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 67 - cellEditable, - cellEditableSet, -#if GTK_CHECK_VERSION(2,6,0) - cellEllipsize, - cellEllipsizeSet, -#endif - cellFamily, - cellFamilySet, - cellFont, - cellFontDesc, hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 70 - cellLanguage, - cellLanguageSet, - cellMarkup, - cellRise, - cellRiseSet, - cellScale, - cellScaleSet, - cellSingleParagraphMode, - cellSize, - cellStretch, - cellStretchSet, - cellStrikethrough, - cellStrikethroughSet, - cellStyle, - cellStyleSet, - cellText, - cellUnderline, - cellUnderlineSet, - cellVariant, - cellVariantSet, - cellWeight, - cellWeightSet, + cellTextEditable, + cellTextEditableSet, + cellTextFont, + cellTextFontDesc, + cellTextFamily, + cellTextFamilySet, + cellTextStyle, + cellTextStyleSet, + cellTextVariant, + cellTextVariantSet, + cellTextWeight, + cellTextWeightSet, + cellTextStretch, + cellTextStretchSet, + cellTextSize, + cellTextSizePoints, + cellTextSizeSet, + cellTextScale, + cellTextScaleSet, + cellTextRise, + cellTextRiseSet, + cellTextStrikethrough, + cellTextStrikethroughSet, + cellTextUnderline, + cellTextUnderlineSet, + cellTextLanguage, + cellTextLanguageSet, hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 98 - cellWidthChars, + cellTextEllipsize, + cellTextEllipsizeSet, + cellTextWidthChars, hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 103 - cellWrapMode, - cellWrapWidth, + cellTextWrapMode, + cellTextWrapWidth, +#endif +#if GTK_CHECK_VERSION(2,10,0) + cellTextAlignment, hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 111 + edited, + +-- * Deprecated +#ifndef DISABLE_DEPRECATED hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 117 +#endif hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 133 -import Graphics.UI.Gtk.Pango.Layout ( LayoutWrapMode ) +{#import Graphics.UI.Gtk.Pango.Layout#} ( LayoutAlignment, LayoutWrapMode ) hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 152 --- 'cellTextFont' and 'cellYPad' attribute set on it. Further changes in these --- properties do not --- affect the height, so they must be accompanied by a subsequent call to this --- function. Using this function is unflexible, and should really only be used --- if calculating the size of a cell is too slow (ie, a massive number of cells --- displayed). If @numberOfRows@ is -1, then the fixed height is unset, and the --- height is determined by the properties again. +-- 'cellTextFont' and 'Graphics.UI.Gtk.ModelView.CellRenderer.cellYPad' +-- attribute set on it. Further changes in these properties do not affect the +-- height, so they must be accompanied by a subsequent call to this function. +-- Using this function is unflexible, and should really only be used if +-- calculating the size of a cell is too slow (ie, a massive number of cells +-- displayed). If @numberOfRows@ is -1, then the fixed height is unset, and +-- the height is determined by the properties again. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 195 -cellEditable :: CellRendererTextClass self => Attr self Bool -cellEditable = newAttrFromBoolProperty "editable" +cellTextEditable :: CellRendererTextClass self => Attr self Bool +cellTextEditable = newAttrFromBoolProperty "editable" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 198 --- | Whether the 'cellEditable' flag affects text editability. +-- | Whether the 'cellTextEditable' flag affects text editability. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 200 -cellEditableSet :: CellRendererTextClass self => Attr self Bool -cellEditableSet = newAttrFromBoolProperty "editable-set" +cellTextEditableSet :: CellRendererTextClass self => Attr self Bool +cellTextEditableSet = newAttrFromBoolProperty "editable-set" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 207 --- ellipsizing. See the 'cellWrapWidth' property for another way of +-- ellipsizing. See the 'cellTextWrapWidth' property for another way of hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 212 -cellEllipsize :: CellRendererTextClass self => Attr self EllipsizeMode -cellEllipsize = newAttrFromEnumProperty "ellipsize" +cellTextEllipsize :: CellRendererTextClass self => Attr self EllipsizeMode +cellTextEllipsize = newAttrFromEnumProperty "ellipsize" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 216 --- | Whether the 'cellEllipsize' tag affects the ellipsize mode. +-- | Whether the 'cellTextEllipsize' tag affects the ellipsize mode. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 220 -cellEllipsizeSet :: CellRendererTextClass self => Attr self Bool -cellEllipsizeSet = newAttrFromBoolProperty "ellipsize-set" +cellTextEllipsizeSet :: CellRendererTextClass self => Attr self Bool +cellTextEllipsizeSet = newAttrFromBoolProperty "ellipsize-set" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 226 -cellFamily :: CellRendererTextClass self => Attr self String -cellFamily = newAttrFromStringProperty "family" +cellTextFamily :: CellRendererTextClass self => Attr self String +cellTextFamily = newAttrFromStringProperty "family" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 229 --- | Determines if 'cellFamily' has an effect. +-- | Determines if 'cellTextFamily' has an effect. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 231 -cellFamilySet :: CellRendererTextClass self => Attr self Bool -cellFamilySet = newAttrFromBoolProperty "family-set" +cellTextFamilySet :: CellRendererTextClass self => Attr self Bool +cellTextFamilySet = newAttrFromBoolProperty "family-set" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 236 -cellFont :: CellRendererTextClass self => Attr self String -cellFont = newAttrFromStringProperty "font" +cellTextFont :: CellRendererTextClass self => Attr self String +cellTextFont = newAttrFromStringProperty "font" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 241 -cellFontDesc :: CellRendererTextClass self => Attr self FontDescription -cellFontDesc = newAttrFromBoxedOpaqueProperty makeNewFontDescription +cellTextFontDesc :: CellRendererTextClass self => Attr self FontDescription +cellTextFontDesc = newAttrFromBoxedOpaqueProperty makeNewFontDescription hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 270 -cellLanguage :: CellRendererTextClass self => Attr self (Maybe String) -cellLanguage = newAttrFromMaybeStringProperty "language" +cellTextLanguage :: CellRendererTextClass self => Attr self (Maybe String) +cellTextLanguage = newAttrFromMaybeStringProperty "language" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 273 --- | Whether the 'cellLanguage' tag is used, default is @False@. +-- | Whether the 'cellTextLanguage' tag is used, default is @False@. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 275 -cellLanguageSet :: CellRendererTextClass self => Attr self Bool -cellLanguageSet = newAttrFromBoolProperty "language-set" +cellTextLanguageSet :: CellRendererTextClass self => Attr self Bool +cellTextLanguageSet = newAttrFromBoolProperty "language-set" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 280 -cellMarkup :: CellRendererTextClass cr => WriteAttr cr (Maybe String) -cellMarkup = writeAttrFromMaybeStringProperty "markup" +cellTextMarkup :: CellRendererTextClass cr => WriteAttr cr (Maybe String) +cellTextMarkup = writeAttrFromMaybeStringProperty "markup" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 283 +-- %hash c:4e25 d:f7c6 hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 287 -cellRise :: CellRendererTextClass self => Attr self Int -cellRise = newAttrFromIntProperty "rise" +-- Allowed values: >= -2147483647 +-- +-- Default value: 0 +-- +cellTextRise :: CellRendererTextClass self => Attr self Int +cellTextRise = newAttrFromIntProperty "rise" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 294 --- | Whether the 'cellRise' tag is used, default is @False@. +-- | Whether the 'cellTextRise' tag is used, default is @False@. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 296 -cellRiseSet :: CellRendererTextClass self => Attr self Bool -cellRiseSet = newAttrFromBoolProperty "rise-set" +cellTextRiseSet :: CellRendererTextClass self => Attr self Bool +cellTextRiseSet = newAttrFromBoolProperty "rise-set" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 301 -cellScale :: CellRendererTextClass self => Attr self Double -cellScale = newAttrFromDoubleProperty "scale" +cellTextScale :: CellRendererTextClass self => Attr self Double +cellTextScale = newAttrFromDoubleProperty "scale" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 304 --- | Whether the 'cellScale' tag is used, default is @False@. +-- | Whether the 'cellTextScale' tag is used, default is @False@. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 306 -cellScaleSet :: CellRendererTextClass self => Attr self Bool -cellScaleSet = newAttrFromBoolProperty "scale-set" +cellTextScaleSet :: CellRendererTextClass self => Attr self Bool +cellTextScaleSet = newAttrFromBoolProperty "scale-set" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 309 +-- %hash c:d85f d:9cfb hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 312 -cellSingleParagraphMode :: CellRendererTextClass self => Attr self Bool -cellSingleParagraphMode = newAttrFromBoolProperty "single-paragraph-mode" +-- Default value: @False@ +-- +cellTextSingleParagraphMode :: CellRendererTextClass self => Attr self Bool +cellTextSingleParagraphMode = newAttrFromBoolProperty "single-paragraph-mode" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 319 -cellSize :: CellRendererTextClass self => Attr self Double -cellSize = newAttrFromDoubleProperty "size-points" +cellTextSize :: CellRendererTextClass self => Attr self Double +cellTextSize = newAttrFromDoubleProperty "size-points" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 322 --- | Whether the 'cellSize' tag is used, default is @False@. +-- %hash c:d281 d:3b0c +-- | Font size in points. +-- +-- Allowed values: >= 0 hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 327 -cellSizeSet :: CellRendererTextClass self => Attr self Bool -cellSizeSet = newAttrFromBoolProperty "size-set" +-- Default value: 0 +-- +cellTextSizePoints :: CellRendererTextClass self => Attr self Double +cellTextSizePoints = newAttrFromDoubleProperty "size-points" + +-- | Whether the 'cellTextSize' tag is used, default is @False@. +-- +cellTextSizeSet :: CellRendererTextClass self => Attr self Bool +cellTextSizeSet = newAttrFromBoolProperty "size-set" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 339 -cellStretch :: CellRendererTextClass self => Attr self Stretch -cellStretch = newAttrFromEnumProperty "stretch" +cellTextStretch :: CellRendererTextClass self => Attr self Stretch +cellTextStretch = newAttrFromEnumProperty "stretch" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 343 --- | Whether the 'cellStretch' tag is used, default is @False@. +-- | Whether the 'cellTextStretch' tag is used, default is @False@. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 345 -cellStretchSet :: CellRendererTextClass self => Attr self Bool -cellStretchSet = newAttrFromBoolProperty "stretch-set" +cellTextStretchSet :: CellRendererTextClass self => Attr self Bool +cellTextStretchSet = newAttrFromBoolProperty "stretch-set" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 350 -cellStrikethrough :: CellRendererTextClass self => Attr self Bool -cellStrikethrough = newAttrFromBoolProperty "strikethrough" +cellTextStrikethrough :: CellRendererTextClass self => Attr self Bool +cellTextStrikethrough = newAttrFromBoolProperty "strikethrough" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 353 --- | Whether the 'cellStrikethrough' tag is used, default is @False@. +-- | Whether the 'cellTextStrikethrough' tag is used, default is @False@. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 355 -cellStrikethroughSet :: CellRendererTextClass self => Attr self Bool -cellStrikethroughSet = newAttrFromBoolProperty "strikethrough-set" +cellTextStrikethroughSet :: CellRendererTextClass self => Attr self Bool +cellTextStrikethroughSet = newAttrFromBoolProperty "strikethrough-set" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 360 -cellStyle :: CellRendererTextClass self => Attr self FontStyle -cellStyle = newAttrFromEnumProperty "style" +cellTextStyle :: CellRendererTextClass self => Attr self FontStyle +cellTextStyle = newAttrFromEnumProperty "style" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 364 --- | Whether the 'cellStyle' tag is used, default is @False@. +-- | Whether the 'cellTextStyle' tag is used, default is @False@. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 366 -cellStyleSet :: CellRendererTextClass self => Attr self Bool -cellStyleSet = newAttrFromBoolProperty "style-set" +cellTextStyleSet :: CellRendererTextClass self => Attr self Bool +cellTextStyleSet = newAttrFromBoolProperty "style-set" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 370 --- also 'cellMarkup'. +-- also 'cellTextMarkup'. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 377 -cellUnderline :: CellRendererTextClass self => Attr self Underline -cellUnderline = newAttrFromEnumProperty "underline" +cellTextUnderline :: CellRendererTextClass self => Attr self Underline +cellTextUnderline = newAttrFromEnumProperty "underline" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 381 --- | Whether the 'cellUnderline' tag is used, default is @False@. +-- | Whether the 'cellTextUnderline' tag is used, default is @False@. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 383 -cellUnderlineSet :: CellRendererTextClass self => Attr self Bool -cellUnderlineSet = newAttrFromBoolProperty "underline-set" +cellTextUnderlineSet :: CellRendererTextClass self => Attr self Bool +cellTextUnderlineSet = newAttrFromBoolProperty "underline-set" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 388 -cellVariant :: CellRendererTextClass self => Attr self Variant -cellVariant = newAttrFromEnumProperty "variant" +cellTextVariant :: CellRendererTextClass self => Attr self Variant +cellTextVariant = newAttrFromEnumProperty "variant" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 392 --- | Whether the 'cellVariant' tag is used, default is @False@. +-- | Whether the 'cellTextVariant' tag is used, default is @False@. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 394 -cellVariantSet :: CellRendererTextClass self => Attr self Bool -cellVariantSet = newAttrFromBoolProperty "variant-set" +cellTextVariantSet :: CellRendererTextClass self => Attr self Bool +cellTextVariantSet = newAttrFromBoolProperty "variant-set" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 399 -cellWeight :: CellRendererTextClass self => Attr self Int -cellWeight = newAttrFromIntProperty "weight" +cellTextWeight :: CellRendererTextClass self => Attr self Int +cellTextWeight = newAttrFromIntProperty "weight" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 402 --- | Whether the 'cellWeight' tag is used, default is @False@. +-- | Whether the 'cellTextWeight' tag is used, default is @False@. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 404 -cellWeightSet :: CellRendererTextClass self => Attr self Bool -cellWeightSet = newAttrFromBoolProperty "weight-set" +cellTextWeightSet :: CellRendererTextClass self => Attr self Bool +cellTextWeightSet = newAttrFromBoolProperty "weight-set" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 416 -cellWidthChars :: CellRendererTextClass self => Attr self Int -cellWidthChars = newAttrFromIntProperty "width-chars" +cellTextWidthChars :: CellRendererTextClass self => Attr self Int +cellTextWidthChars = newAttrFromIntProperty "width-chars" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 425 --- This property has no effect unless the 'cellWrapWidth' property is set. +-- This property has no effect unless the 'cellTextWrapWidth' property is set. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 429 -cellWrapMode :: CellRendererTextClass self => Attr self LayoutWrapMode -cellWrapMode = newAttrFromEnumProperty "wrap-mode" +cellTextWrapMode :: CellRendererTextClass self => Attr self LayoutWrapMode +cellTextWrapMode = newAttrFromEnumProperty "wrap-mode" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 439 -cellWrapWidth :: CellRendererTextClass self => Attr self Int -cellWrapWidth = newAttrFromIntProperty "wrap-width" +cellTextWrapWidth :: CellRendererTextClass self => Attr self Int +cellTextWrapWidth = newAttrFromIntProperty "wrap-width" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 444 --- | Emitted when the user finished editing a cell. + +#if GTK_CHECK_VERSION(2,10,0) +-- %hash c:a59c d:a84a +-- | Specifies how to align the lines of text with respect to each other. +-- +-- Note that this property describes how to align the lines of text in case +-- there are several of them. The +-- 'Graphics.UI.Gtk.ModelView.CellRenderer.cellXAlign' property of +-- 'CellRenderer', on the other hand, sets the horizontal alignment of the +-- whole text. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 455 --- * Whenever editing is finished successfully, this signal is emitted which --- indicates that the model should be updated with the supplied value. --- The value is always a string which matches 'CellRendererText' renderers --- and 'CellRendererCombo' when the combo box accepts additional entries. --- If the combo box has a predefined set of possible selections, the --- string that this handler receives is always empty. In this case the --- handler --- of this signal needs to query the currently selected index of the combo --- box and store that index in the model of this cell renderer. The only --- time this combo box is passed to the user program is in the --- 'onEditingStarted' signal of the 'CellRenderer' base class. Hence, --- when this handler is run, the handler to store the resulting value --- needs to be installed using this function. See the --- user manual for an example of this. +-- Default value: 'Graphics.UI.Gtk.Pango.Layout.AlignLeft' +-- +-- * Available since Gtk+ version 2.10 +-- +cellTextAlignment :: CellRendererTextClass self => Attr self LayoutAlignment +cellTextAlignment = newAttrFromEnumProperty "alignment" + {# call pure unsafe pango_alignment_get_type #} +#endif + +-------------------- +-- Signals + +-- %hash c:a541 d:18f9 +-- | Emitted when the user finished editing a cell. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 470 +-- Whenever editing is finished successfully, this signal is emitted which +-- indicates that the model should be updated with the supplied value. +-- The value is always a string which matches the 'cellText' attribute of +-- 'CellRendererText' (and its derivates like 'CellRendererCombo'). +-- [_$_] hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 476 --- 'cellEditable') or when the user aborts editing. +-- 'cellTextEditable') or when the user aborts editing. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 478 -onEdited, afterEdited :: CellRendererTextClass cr => - cr -> (TreePath -> String -> IO ()) -> - IO (ConnectId cr) +edited :: CellRendererTextClass self => + Signal self (TreePath -> String -> IO ()) +edited = Signal internalEdited + +-------------------- +-- Deprecated Signals + +#ifndef DISABLE_DEPRECATED +-- %hash c:76ed +onEdited :: CellRendererTextClass self => self + -> (TreePath -> String -> IO ()) + -> IO (ConnectId self) hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 491 +{-# DEPRECATED onEdited "instead of 'onEdited obj' use 'on obj edited'" #-} + +-- %hash c:f70c +afterEdited :: CellRendererTextClass self => self + -> (TreePath -> String -> IO ()) + -> IO (ConnectId self) hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 498 +{-# DEPRECATED afterEdited "instead of 'afterEdited obj' use 'after obj edited'" #-} +#endif hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererToggle.chs.pp 59 - cellActive, - cellInconsistent, - cellActivatable, - cellRadio, + cellToggleActive, + cellToggleInconsistent, + cellToggleActivatable, + cellToggleRadio, + cellToggleIndicatorSize, + +-- * Signals + toggled, + +-- * Deprecated +#ifndef DISABLE_DEPRECATED + onToggled, + afterToggled +#endif hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererToggle.chs.pp 79 -import System.Glib.Properties (newAttrFromBoolProperty) +import System.Glib.Properties (newAttrFromBoolProperty, + newAttrFromIntProperty) hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererToggle.chs.pp 83 +{#import Graphics.UI.Gtk.Signals#} hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererToggle.chs.pp 90 --- | Create a new 'CellRenderer' that displays a 'ToggleButton'. +-- %hash c:bafb d:640f +-- | Creates a new 'CellRendererToggle'. Adjust rendering parameters using +-- object properties. Object properties can be set globally (with +-- 'System.Glib.Attributes.set'). Also, within a +-- 'Graphics.UI.Gtk.ModelView.TreeViewColumn', you can bind a property to a +-- value in a 'Graphics.UI.Gtk.ModelView.TreeModel.TreeModel' using +-- 'Graphics.UI.Gtk.ModelView.CellLayout.cellLayoutSetAttributes'. For +-- example, you can bind the 'cellToggleActive' property on the cell renderer +-- to a boolean value in the model, thus causing the check button to reflect +-- the state of the model. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererToggle.chs.pp 110 --- | Determine whether the button is drawn as 'RadioButton' or not. +-- %hash c:133b d:c428 +-- | If @radio@ is @True@, the cell renderer renders a radio toggle (i.e. a +-- toggle in a group of mutually-exclusive toggles). If @False@, it renders a +-- check toggle (a standalone boolean option). This can be set globally for +-- the cell renderer, or changed just before rendering each cell in the model +-- (for 'TreeView', you set up a per-row setting using 'TreeViewColumn' to +-- associate model columns with cell renderer properties). hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererToggle.chs.pp 119 - -> Bool + -> Bool -- ^ @radio@ - @True@ to make the toggle look like a radio button hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererToggle.chs.pp 126 --- | Returns whether the button is drawn as 'RadioButton' or not. +-- %hash c:7f39 d:fe9f +-- | Returns whether we\'re rendering radio toggles rather than checkboxes. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererToggle.chs.pp 129 -cellRendererToggleGetRadio :: CellRendererToggleClass self => self -> IO Bool +cellRendererToggleGetRadio :: CellRendererToggleClass self => self + -> IO Bool -- ^ returns @True@ if we\'re rendering radio toggles rather than + -- checkboxes hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererToggle.chs.pp 137 --- | Retrieve the current state of the button. +-- %hash c:4974 d:3d45 +-- | Returns whether the cell renderer is active. See +-- 'cellRendererToggleSetActive'. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererToggle.chs.pp 141 -cellRendererToggleGetActive :: CellRendererToggleClass self => self -> IO Bool +cellRendererToggleGetActive :: CellRendererToggleClass self => self + -> IO Bool -- ^ returns @True@ if the cell renderer is active. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererToggle.chs.pp 148 - --- | Modify the state of the button. +-- %hash c:8420 d:5177 +-- | Activates or deactivates a cell renderer. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererToggle.chs.pp 152 - -> Bool + -> Bool -- ^ @setting@ - the value to set. hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererToggle.chs.pp 162 +-- %hash c:aed9 d:ab32 hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererToggle.chs.pp 167 -cellActive :: CellRendererToggleClass self => Attr self Bool -cellActive = newAttrFromBoolProperty "active" +cellToggleActive :: CellRendererToggleClass self => Attr self Bool +cellToggleActive = newAttrFromBoolProperty "active" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererToggle.chs.pp 170 +-- %hash c:85c8 d:8ab1 hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererToggle.chs.pp 175 -cellInconsistent :: CellRendererToggleClass self => Attr self Bool -cellInconsistent = newAttrFromBoolProperty "inconsistent" +cellToggleInconsistent :: CellRendererToggleClass self => Attr self Bool +cellToggleInconsistent = newAttrFromBoolProperty "inconsistent" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererToggle.chs.pp 178 +-- %hash c:74e5 d:e41e hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererToggle.chs.pp 183 -cellActivatable :: CellRendererToggleClass self => Attr self Bool -cellActivatable = newAttrFromBoolProperty "activatable" +cellToggleActivatable :: CellRendererToggleClass self => Attr self Bool +cellToggleActivatable = newAttrFromBoolProperty "activatable" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererToggle.chs.pp 186 +-- %hash c:61f2 d:5449 hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererToggle.chs.pp 191 -cellRadio :: CellRendererToggleClass self => Attr self Bool -cellRadio = newAttrFromBoolProperty "radio" +cellToggleRadio :: CellRendererToggleClass self => Attr self Bool +cellToggleRadio = newAttrFromBoolProperty "radio" + +-- %hash c:698 d:47b4 +-- | Size of check or radio indicator. +-- +-- Allowed values: >= 0 +-- +-- Default value: 12 +-- +cellToggleIndicatorSize :: CellRendererToggleClass self => Attr self Int +cellToggleIndicatorSize = newAttrFromIntProperty "indicator-size" + +-------------------- +-- Signals + +-- %hash c:33ab d:1ba3 +-- | The ::toggled signal is emitted when the cell is toggled. +-- +toggled :: CellRendererToggleClass self => Signal self (String -> IO ()) +toggled = Signal (connect_STRING__NONE "toggled") + +-------------------- +-- Deprecated Signals + +#ifndef DISABLE_DEPRECATED +-- %hash c:21f7 +onToggled :: CellRendererToggleClass self => self + -> (String -> IO ()) + -> IO (ConnectId self) +onToggled = connect_STRING__NONE "toggled" False +{-# DEPRECATED onToggled "instead of 'onToggled obj' use 'on obj toggled'" #-} + +-- %hash c:82f6 +afterToggled :: CellRendererToggleClass self => self + -> (String -> IO ()) + -> IO (ConnectId self) +afterToggled = connect_STRING__NONE "toggled" True +{-# DEPRECATED afterToggled "instead of 'afterToggled obj' use 'after obj toggled'" #-} +#endif hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 8 --- Copyright (C) 2004-2005 Duncan Coutts +-- Copyright (C) 2004-2007 Duncan Coutts, Axel Simon hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 30 + hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 32 --- [_$_] +-- hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 42 --- tree model, and the display of the choices can be adapted to the data in the --- model by using cell renderers, as you would in a tree view. This is possible --- since 'ComboBox' implements the 'CellLayout' interface. The tree model --- holding the valid choices is not restricted to a flat list, it can be a real --- tree, and the popup will reflect the tree structure. +-- tree model, and the display of the choices can be adapted to the data in +-- the model by using cell renderers, as you would in a tree view. This is +-- possible since 'ComboBox' implements the 'CellLayout' interface. The tree +-- model holding the valid choices is not restricted to a flat list, it can be +-- a real tree, and the popup will reflect the tree structure. hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 48 --- In addition to the model-view API, 'ComboBox' offers a simple API which --- is suitable for text-only combo boxes, and hides the complexity of managing --- the data in a model. It consists of the functions 'comboBoxNewText', --- 'comboBoxAppendText', 'comboBoxInsertText', 'comboBoxPrependText', --- 'comboBoxRemoveText' and 'comboBoxGetActiveText'. +-- In addition to the general model-view API, 'ComboBox' offers the function +-- 'comboBoxNewText' which creates a text-only combo box. hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 52 +-- hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 78 - comboBoxSetRowSpanColumn, - comboBoxSetColumnSpanColumn, + comboBoxSetRowSpanSource, +#if GTK_CHECK_VERSION(2,6,0) + comboBoxSetColumnSpanSource, +#endif hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 88 - comboBoxAppendText, - comboBoxInsertText, - comboBoxPrependText, - comboBoxRemoveText, hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 92 - comboBoxGetRowSpanColumn, - comboBoxGetColumnSpanColumn, - comboBoxGetActiveText, hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 93 +#endif hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 95 +#if GTK_CHECK_VERSION(2,6,0) hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 98 + comboBoxSetRowSeparatorSource, +#if GTK_CHECK_VERSION(2,10,0) + comboBoxSetTitle, + comboBoxGetTitle, +#endif hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 106 -#if GTK_CHECK_VERSION(2,6,0) hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 110 + comboBoxActive, +#if GTK_CHECK_VERSION(2,6,0) hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 115 +#if GTK_CHECK_VERSION(2,10,0) + comboBoxTearoffTitle, + comboBoxPopupShown, +#endif + comboBoxTitle, hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 123 + changed, + popupShownNotify, + [_$_] +-- * Deprecated +#ifndef DISABLE_DEPRECATED hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 131 +#endif hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 141 -import System.Glib.GObject (makeNewGObject) -{#import Graphics.UI.Gtk.Types#} +import System.Glib.GObject (makeNewGObject, + mkFunPtrDestroyNotify) +{#import Graphics.UI.Gtk.Types#} hiding (ListStore) +import Graphics.UI.Gtk.ModelView.Types (TypedTreeModelClass) hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 147 -{#import Graphics.UI.Gtk.ModelView.CustomStore#} () - +{#import Graphics.UI.Gtk.ModelView.CustomStore#} (treeModelUpdateColumn, + treeModelGetRow, + ColumnAccess(CAInt)) +import Graphics.UI.Gtk.ModelView.ListStore ( ListStore, listStoreNew ) +import Graphics.UI.Gtk.ModelView.CellLayout ( cellLayoutSetAttributes, + cellLayoutPackStart ) +import Graphics.UI.Gtk.ModelView.CellRendererText ( cellRendererTextNew, [_$_] + cellText) hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 171 --- text combo box, you should only manipulate its data source with the --- following convenience functions: 'comboBoxAppendText', 'comboBoxInsertText', --- 'comboBoxPrependText' and 'comboBoxRemoveText'. +-- text combo box, you can supply the @id@ function as first argument. In this +-- case 'comboBoxNewText' will return a @'Graphics.UI.Gtk.ModelView.ListStore' +-- String@ containing the initial list of strings. hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 175 -comboBoxNewText :: IO ComboBox -comboBoxNewText = - makeNewObject mkComboBox $ - liftM (castPtr :: Ptr Widget -> Ptr ComboBox) $ - {# call gtk_combo_box_new_text #} +comboBoxNewText :: + (a -> String) -- ^ a function to extract elements from a the store + -> [a] -- ^ the initial contents of the store + -> IO (ComboBox, ListStore a) -- the resulting combo box and the store +comboBoxNewText extract initial = do + store <- listStoreNew initial + combo <- comboBoxNewWithModel store + ren <- cellRendererTextNew + cellLayoutPackStart combo ren True + cellLayoutSetAttributes combo ren store (\a -> [cellText := extract a]) + return (combo, store) hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 187 +-- %hash c:2570 hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 190 -comboBoxNewWithModel :: TreeModelClass model => [_$_] - model -- ^ @model@ - A 'TreeModel'. +comboBoxNewWithModel :: TreeModelClass model => + model -- ^ @model@ - A 'TreeModel'. hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 196 - {# call gtk_combo_box_new_with_model #} (toTreeModel model) + {# call gtk_combo_box_new_with_model #} + (toTreeModel model) hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 202 +-- %hash d:566e +-- | Sets the wrap width of @comboBox@ to be @width@. The wrap width is +#if GTK_CHECK_VERSION(2,6,0) +-- | Returns the wrap width which is used to determine the number of columns +-- for the popup menu. If the wrap width is larger than 1, the combo box is in +-- table mode. +-- +-- * Available since Gtk+ version 2.6 +-- +comboBoxGetWrapWidth :: ComboBoxClass self => self -> IO Int +comboBoxGetWrapWidth self = + liftM fromIntegral $ + {# call gtk_combo_box_get_wrap_width #} + (toComboBox self) + hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 219 --- layed out in a table. +-- laid out in a table. hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 227 --- | Sets the column with row span information for the combo box to be @rowSpan@. --- The row span column contains integers which indicate how many rows an item --- should span. +-- %hash d:f80b +-- | Sets the source of the row span information for the combo box. The +-- row span source contains integers which indicate how many rows an +-- item should span. hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 232 -comboBoxSetRowSpanColumn :: ComboBoxClass self => self -> Int -> IO () -comboBoxSetRowSpanColumn self rowSpan = +comboBoxSetRowSpanSource :: (ComboBoxClass self, + TreeModelClass (model row), + TypedTreeModelClass model) + => self -- ^ the 'ComboBox' widget + -> Maybe (model row, row -> Int) + -- ^ The model and a function to extract the number of rows + -- from the model. If set to @Nothing@, the mapping is reset. + -> IO () +comboBoxSetRowSpanSource self Nothing = hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 242 - (toComboBox self) - (fromIntegral rowSpan) + (toComboBox self) (-1) +comboBoxSetRowSpanSource self (Just (model, extract)) = do + modelPtr <- {#call unsafe gtk_combo_box_get_model#} (toComboBox self) + let (TreeModel modelFPtr) = toTreeModel model + if modelPtr/=unsafeForeignPtrToPtr modelFPtr then + error ("comboBoxSetRowSpanSource: given model is different from what "++ + "comboBoxGetModel returns") else do + col <- {# call gtk_combo_box_get_row_span_column #} (toComboBox self) + col <- treeModelUpdateColumn model (fromIntegral col) (CAInt extract) + {#call gtk_combo_box_set_row_span_column #} (toComboBox self) + (fromIntegral col) hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 254 --- | Sets the column with column span information for the combo box to be --- @columnSpan@. The column span column contains integers which indicate how --- many columns an item should span. +#if GTK_CHECK_VERSION(2,6,0) +-- %hash d:4303 +-- | Sets the source of the column span information for the combo box. The +-- column span source contains integers which indicate how many columns an +-- item should span. +-- +-- * Available since Gtk+ version 2.6 hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 262 -comboBoxSetColumnSpanColumn :: ComboBoxClass self => self -> Int -> IO () -comboBoxSetColumnSpanColumn self columnSpan = +comboBoxSetColumnSpanSource :: (ComboBoxClass self, + TreeModelClass (model row), + TypedTreeModelClass model) + => self -- ^ the 'ComboBox' widget + -> Maybe (model row, row -> Int) + -- ^ The model and a function to extract the number of rows + -- from the model. If set to @Nothing@, the mapping is reset. + -> IO () +comboBoxSetColumnSpanSource self Nothing = hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 272 - (toComboBox self) - (fromIntegral columnSpan) + (toComboBox self) (-1) +comboBoxSetColumnSpanSource self (Just (model, extract)) = do + modelPtr <- {#call unsafe gtk_combo_box_get_model#} (toComboBox self) + let (TreeModel modelFPtr) = toTreeModel model + if modelPtr/=unsafeForeignPtrToPtr modelFPtr then + error ("comboBoxSetRowSpanSource: given model is different from what "++ + "comboBoxGetModel returns") else do + col <- {# call gtk_combo_box_get_column_span_column #} (toComboBox self) + col <- treeModelUpdateColumn model (fromIntegral col) (CAInt extract) + {#call gtk_combo_box_set_column_span_column #} (toComboBox self) + (fromIntegral col) +#endif hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 285 --- | Returns the index of the currently active item, or @Nothing@ if there's no +-- %hash c:e719 d:e6a +-- | Returns the index of the currently active item, or -1 if there's no hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 293 - -> IO (Maybe Int) -- ^ returns An integer which is the index of the currently - -- active item, or @Nothing@ if there's no active item. + -> IO Int -- ^ returns An integer which is the index of the currently active + -- item, or -1 if there's no active item. hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 296 + liftM fromIntegral $ hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 299 - >>= \index -> if index == -1 - then return Nothing - else return (Just $ fromIntegral index) hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 300 --- | Sets the active item of the combo box to be the item at @index@. +-- %hash c:3572 d:fbed +-- | Sets the active item of @comboBox@ to be the item at @index@. hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 304 - -> Int -- ^ @index@ - An index in the model passed during construction, or - -- -1 to have no active item. + -> Int -- ^ @index@ - An index in the model passed during construction, or -1 + -- to have no active item. hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 312 --- | Returns a 'TreeIter' that points to the current active item, if it exists, --- or @Nothing@ if there is no current active item. +-- %hash c:744a d:e897 +-- | Returns a 'TreeIter' that points to the current active item, if it +-- exists, or @Nothing@ if there is no current active item. hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 323 +-- %hash c:9a70 hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 336 +-- %hash c:2460 hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 345 - {# call gtk_combo_box_get_model #} + {# call unsafe gtk_combo_box_get_model #} hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 348 +-- %hash c:f5d0 hunk ./gtk/Graphics/UI/Gtk/ModelView/ComboBox.chs.pp 353 --- No... [truncated message content] |