gi-gtk-4.0.11: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.CellRendererCombo

Description

Renders a combobox in a cell

GtkCellRendererCombo renders text in a cell like GtkCellRendererText from which it is derived. But while GtkCellRendererText offers a simple entry to edit the text, GtkCellRendererCombo offers a GtkComboBox widget to edit the text. The values to display in the combo box are taken from the tree model specified in the GtkCellRendererCombo: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 GtkCellRendererCombo:text-column property. Further properties of the combo box can be set in a handler for the GtkCellRenderer::editing-started signal.

Synopsis

Exported types

class (GObject o, IsDescendantOf CellRendererCombo o) => IsCellRendererCombo o Source #

Type class for types which can be safely cast to CellRendererCombo, for instance with toCellRendererCombo.

Instances

Instances details
(GObject o, IsDescendantOf CellRendererCombo o) => IsCellRendererCombo o Source # 
Instance details

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.

Methods

new

cellRendererComboNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m CellRendererCombo

Returns: the new cell renderer

Deprecated: (Since version 4.10)

Creates a new GtkCellRendererCombo. Adjust how text is drawn using object properties. Object properties can be set globally (with g_object_set()). Also, with GtkTreeViewColumn, you can bind a property to a value in a GtkTreeModel. 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 GtkTreeView.

Properties

hasEntry

If True, the cell renderer will include an entry and allow to enter values other than the ones in the popup list.

constructCellRendererComboHasEntry :: (IsCellRendererCombo o, MonadIO m) => Bool -> m (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.

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, MonadIO m, IsTreeModel a) => a -> m (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.

GtkCellRendererCombo automatically adds a text cell renderer for this column to its combo box.

constructCellRendererComboTextColumn :: (IsCellRendererCombo o, MonadIO m) => Int32 -> m (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 CellRendererComboChangedCallback Source #

Arguments

 = Text

pathString: a string of the path identifying the edited cell (relative to the tree view model)

-> TreeIter

newIter: the new iter selected in the combo box (relative to the combo box model)

-> 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, GtkCellRendererCombochanged 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.

afterCellRendererComboChanged :: (IsCellRendererCombo a, MonadIO m) => a -> ((?self :: 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

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onCellRendererComboChanged :: (IsCellRendererCombo a, MonadIO m) => a -> ((?self :: 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