gi-gtk4-4.0.12: Gtk 4.x bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gtk.Objects.CellRendererCombo

Contents

- Exported types
- Methods
  - new
- Properties
  - hasEntry
  - model
  - textColumn
- Signals
  - changed

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

- newtype CellRendererCombo = CellRendererCombo (ManagedPtr CellRendererCombo)
- class (GObject o, IsDescendantOf CellRendererCombo o) => IsCellRendererCombo o
- toCellRendererCombo :: (MonadIO m, IsCellRendererCombo o) => o -> m CellRendererCombo
- cellRendererComboNew :: (HasCallStack, MonadIO m) => m CellRendererCombo
- constructCellRendererComboHasEntry :: (IsCellRendererCombo o, MonadIO m) => Bool -> m (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, MonadIO m, IsTreeModel a) => a -> m (GValueConstruct o)
- getCellRendererComboModel :: (MonadIO m, IsCellRendererCombo o) => o -> m (Maybe TreeModel)
- setCellRendererComboModel :: (MonadIO m, IsCellRendererCombo o, IsTreeModel a) => o -> a -> m ()
- constructCellRendererComboTextColumn :: (IsCellRendererCombo o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getCellRendererComboTextColumn :: (MonadIO m, IsCellRendererCombo o) => o -> m Int32
- setCellRendererComboTextColumn :: (MonadIO m, IsCellRendererCombo o) => o -> Int32 -> m ()
- type CellRendererComboChangedCallback = Text -> TreeIter -> IO ()
- afterCellRendererComboChanged :: (IsCellRendererCombo a, MonadIO m) => a -> ((?self :: a) => CellRendererComboChangedCallback) -> m SignalHandlerId
- onCellRendererComboChanged :: (IsCellRendererCombo a, MonadIO m) => a -> ((?self :: a) => CellRendererComboChangedCallback) -> m SignalHandlerId

# Exported types

newtype CellRendererCombo Source #

Memory-managed wrapper type.

Constructors

CellRendererCombo (ManagedPtr CellRendererCombo) |

#### Instances

Instances details

Eq CellRendererCombo Source # |
Instance details Defined in GI.Gtk.Objects.CellRendererCombo Methods (==) :: CellRendererCombo -> CellRendererCombo -> Bool Source # (/=) :: CellRendererCombo -> CellRendererCombo -> Bool Source #
GObject CellRendererCombo Source # |
Instance details Defined in GI.Gtk.Objects.CellRendererCombo
ManagedPtrNewtype CellRendererCombo Source # |
Instance details Defined in GI.Gtk.Objects.CellRendererCombo Methods toManagedPtr :: CellRendererCombo -> ManagedPtr CellRendererCombo Source #
TypedObject CellRendererCombo Source # |
Instance details Defined in GI.Gtk.Objects.CellRendererCombo Methods glibType :: IO GType Source #
HasParentTypes CellRendererCombo Source # |
Instance details Defined in GI.Gtk.Objects.CellRendererCombo
IsGValue (Maybe CellRendererCombo) Source # | Convert `CellRendererCombo` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Objects.CellRendererCombo Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe CellRendererCombo -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe CellRendererCombo) Source #
type ParentTypes CellRendererCombo Source # |
Instance details Defined in GI.Gtk.Objects.CellRendererCombo type ParentTypes CellRendererCombo = '[CellRendererText, CellRenderer, Object]

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

### Click to display all available methods, including inherited ones

Expand

#### Methods

activate, bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isActivatable, isFloating, notify, notifyByPspec, ref, refSink, runDispose, snapshot, startEditing, stealData, stealQdata, stopEditing, thawNotify, unref, watchClosure.

#### Getters

getAlignedArea, getAlignment, getData, getFixedSize, getIsExpanded, getIsExpander, getPadding, getPreferredHeight, getPreferredHeightForWidth, getPreferredSize, getPreferredWidth, getPreferredWidthForHeight, getProperty, getQdata, getRequestMode, getSensitive, getState, getVisible.

#### Setters

setAlignment, setData, setDataFull, setFixedHeightFromFont, setFixedSize, setIsExpanded, setIsExpander, setPadding, setProperty, setSensitive, setVisible.

## 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