Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
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
widget to edit the text. The values to display in the combo box are taken from
the tree model specified in the CellRendererCombo
:model
property.
The combo cell renderer takes care of adding a text cell renderer to the combo
box and sets it to display the column specified by its
CellRendererCombo
:text-column
property. Further properties of the combo box
can be set in a handler for the CellRenderer
::editing-started
signal.
The CellRendererCombo
cell renderer was added in GTK+ 2.6.
Synopsis
- newtype CellRendererCombo = CellRendererCombo (ManagedPtr CellRendererCombo)
- class GObject o => IsCellRendererCombo o
- toCellRendererCombo :: (MonadIO m, IsCellRendererCombo o) => o -> m CellRendererCombo
- noCellRendererCombo :: Maybe CellRendererCombo
- cellRendererComboNew :: (HasCallStack, MonadIO m) => m CellRendererCombo
- constructCellRendererComboHasEntry :: IsCellRendererCombo o => Bool -> IO (GValueConstruct o)
- getCellRendererComboHasEntry :: (MonadIO m, IsCellRendererCombo o) => o -> m Bool
- setCellRendererComboHasEntry :: (MonadIO m, IsCellRendererCombo o) => o -> Bool -> m ()
- clearCellRendererComboModel :: (MonadIO m, IsCellRendererCombo o) => o -> m ()
- constructCellRendererComboModel :: (IsCellRendererCombo o, IsTreeModel a) => a -> IO (GValueConstruct o)
- getCellRendererComboModel :: (MonadIO m, IsCellRendererCombo o) => o -> m (Maybe TreeModel)
- setCellRendererComboModel :: (MonadIO m, IsCellRendererCombo o, IsTreeModel a) => o -> a -> m ()
- constructCellRendererComboTextColumn :: IsCellRendererCombo o => Int32 -> IO (GValueConstruct o)
- getCellRendererComboTextColumn :: (MonadIO m, IsCellRendererCombo o) => o -> m Int32
- setCellRendererComboTextColumn :: (MonadIO m, IsCellRendererCombo o) => o -> Int32 -> m ()
- type C_CellRendererComboChangedCallback = Ptr () -> CString -> Ptr TreeIter -> Ptr () -> IO ()
- type CellRendererComboChangedCallback = Text -> TreeIter -> IO ()
- afterCellRendererComboChanged :: (IsCellRendererCombo a, MonadIO m) => a -> CellRendererComboChangedCallback -> m SignalHandlerId
- genClosure_CellRendererComboChanged :: CellRendererComboChangedCallback -> IO Closure
- mk_CellRendererComboChangedCallback :: C_CellRendererComboChangedCallback -> IO (FunPtr C_CellRendererComboChangedCallback)
- noCellRendererComboChangedCallback :: Maybe CellRendererComboChangedCallback
- onCellRendererComboChanged :: (IsCellRendererCombo a, MonadIO m) => a -> CellRendererComboChangedCallback -> m SignalHandlerId
- wrap_CellRendererComboChangedCallback :: CellRendererComboChangedCallback -> C_CellRendererComboChangedCallback
Exported types
newtype CellRendererCombo Source #
Memory-managed wrapper type.
Instances
class GObject o => IsCellRendererCombo o Source #
Type class for types which can be safely cast to CellRendererCombo
, for instance with toCellRendererCombo
.
Instances
(GObject a, (UnknownAncestorError CellRendererCombo a :: Constraint)) => IsCellRendererCombo a Source # | |
Defined in GI.Gtk.Objects.CellRendererCombo | |
IsCellRendererCombo CellRendererCombo Source # | |
Defined in GI.Gtk.Objects.CellRendererCombo |
toCellRendererCombo :: (MonadIO m, IsCellRendererCombo o) => o -> m CellRendererCombo Source #
Cast to CellRendererCombo
, for types for which this is known to be safe. For general casts, use castTo
.
noCellRendererCombo :: Maybe CellRendererCombo Source #
A convenience alias for Nothing
:: Maybe
CellRendererCombo
.
Methods
new
:: (HasCallStack, MonadIO m) | |
=> m CellRendererCombo | Returns: the new cell renderer |
Creates a new CellRendererCombo
.
Adjust how text is drawn using object properties.
Object properties can be set globally (with g_object_set()
).
Also, with TreeViewColumn
, you can bind a property to a value
in a TreeModel
. For example, you can bind the “text” property
on the cell renderer to a string value in the model, thus rendering
a different string in each row of the TreeView
.
Since: 2.6
Properties
hasEntry
If True
, the cell renderer will include an entry and allow to enter
values other than the ones in the popup list.
Since: 2.6
constructCellRendererComboHasEntry :: IsCellRendererCombo o => Bool -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “has-entry
” property. This is rarely needed directly, but it is used by new
.
getCellRendererComboHasEntry :: (MonadIO m, IsCellRendererCombo o) => o -> m Bool Source #
Get the value of the “has-entry
” property.
When overloading is enabled, this is equivalent to
get
cellRendererCombo #hasEntry
setCellRendererComboHasEntry :: (MonadIO m, IsCellRendererCombo o) => o -> Bool -> m () Source #
Set the value of the “has-entry
” property.
When overloading is enabled, this is equivalent to
set
cellRendererCombo [ #hasEntry:=
value ]
model
Holds a tree model containing the possible values for the combo box. Use the text_column property to specify the column holding the values.
Since: 2.6
clearCellRendererComboModel :: (MonadIO m, IsCellRendererCombo o) => o -> m () Source #
Set the value of the “model
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#model
constructCellRendererComboModel :: (IsCellRendererCombo o, IsTreeModel a) => a -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “model
” property. This is rarely needed directly, but it is used by new
.
getCellRendererComboModel :: (MonadIO m, IsCellRendererCombo o) => o -> m (Maybe TreeModel) Source #
Get the value of the “model
” property.
When overloading is enabled, this is equivalent to
get
cellRendererCombo #model
setCellRendererComboModel :: (MonadIO m, IsCellRendererCombo o, IsTreeModel a) => o -> a -> m () Source #
Set the value of the “model
” property.
When overloading is enabled, this is equivalent to
set
cellRendererCombo [ #model:=
value ]
textColumn
Specifies the model column which holds the possible values for the combo box.
Note that this refers to the model specified in the model property, not the model backing the tree view to which this cell renderer is attached.
CellRendererCombo
automatically adds a text cell renderer for
this column to its combo box.
Since: 2.6
constructCellRendererComboTextColumn :: IsCellRendererCombo o => Int32 -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “text-column
” property. This is rarely needed directly, but it is used by new
.
getCellRendererComboTextColumn :: (MonadIO m, IsCellRendererCombo o) => o -> m Int32 Source #
Get the value of the “text-column
” property.
When overloading is enabled, this is equivalent to
get
cellRendererCombo #textColumn
setCellRendererComboTextColumn :: (MonadIO m, IsCellRendererCombo o) => o -> Int32 -> m () Source #
Set the value of the “text-column
” property.
When overloading is enabled, this is equivalent to
set
cellRendererCombo [ #textColumn:=
value ]
Signals
changed
type C_CellRendererComboChangedCallback = Ptr () -> CString -> Ptr TreeIter -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type CellRendererComboChangedCallback Source #
= Text |
|
-> TreeIter |
|
-> IO () |
This signal is emitted each time after the user selected an item in
the combo box, either by using the mouse or the arrow keys. Contrary
to GtkComboBox, GtkCellRendererCombo::changed is not emitted for
changes made to a selected item in the entry. The argument newIter
corresponds to the newly selected item in the combo box and it is relative
to the GtkTreeModel set via the model property on GtkCellRendererCombo.
Note that as soon as you change the model displayed in the tree view, the tree view will immediately cease the editing operating. This means that you most probably want to refrain from changing the model until the combo cell renderer emits the edited or editing_canceled signal.
Since: 2.14
afterCellRendererComboChanged :: (IsCellRendererCombo a, MonadIO m) => a -> CellRendererComboChangedCallback -> m SignalHandlerId Source #
Connect a signal handler for the “changed
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
cellRendererCombo #changed callback
genClosure_CellRendererComboChanged :: CellRendererComboChangedCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_CellRendererComboChangedCallback :: C_CellRendererComboChangedCallback -> IO (FunPtr C_CellRendererComboChangedCallback) Source #
Generate a function pointer callable from C code, from a C_CellRendererComboChangedCallback
.
noCellRendererComboChangedCallback :: Maybe CellRendererComboChangedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
CellRendererComboChangedCallback
onCellRendererComboChanged :: (IsCellRendererCombo a, MonadIO m) => a -> CellRendererComboChangedCallback -> m SignalHandlerId Source #
Connect a signal handler for the “changed
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
cellRendererCombo #changed callback