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

GI.Gtk.Objects.CellRenderer

Description

The CellRenderer is a base class of a set of objects used for rendering a cell to a Context. These objects are used primarily by the TreeView widget, though they aren’t tied to them in any specific way. It is worth noting that CellRenderer is not a Widget and cannot be treated as such.

The primary use of a CellRenderer is for drawing a certain graphical elements on a Context. Typically, one cell renderer is used to draw many 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 using GObjects property system. Then, the cell is measured using cellRendererGetSize. Finally, the cell is rendered in the correct location using cellRendererRender.

There are a number of rules that must be followed when writing a new CellRenderer. First and foremost, it’s important that a certain set of properties will always yield a cell renderer of the same size, barring a Style change. The CellRenderer also has a number of generic properties that are expected to be honored by all children.

Beyond merely rendering a cell, cell renderers can optionally provide active user interface elements. A cell renderer can be “activatable” like 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 widget implementing the CellEditable interface, e.g. Entry. To make a cell renderer activatable or editable, you have to implement the CellRendererClass.activate or CellRendererClass.start_editing virtual functions, respectively.

Many properties of CellRenderer and its subclasses have a corresponding “set” property, e.g. “cell-background-set” corresponds to “cell-background”. These “set” properties reflect whether a property has been set or not. You should not set them independently.

Synopsis

Exported types

newtype CellRenderer Source #

Memory-managed wrapper type.

class (GObject o, IsDescendantOf CellRenderer o) => IsCellRenderer o Source #

Type class for types which can be safely cast to CellRenderer, for instance with toCellRenderer.

Instances

Instances details
(GObject o, IsDescendantOf CellRenderer o) => IsCellRenderer o Source # 
Instance details

Defined in GI.Gtk.Objects.CellRenderer

toCellRenderer :: (MonadIO m, IsCellRenderer o) => o -> m CellRenderer Source #

Cast to CellRenderer, for types for which this is known to be safe. For general casts, use castTo.

Methods

Overloaded methods

activate

cellRendererActivate Source #

Arguments

:: (HasCallStack, MonadIO m, IsCellRenderer a, IsWidget b) 
=> a

cell: a CellRenderer

-> Event

event: a Event

-> b

widget: widget that received the event

-> Text

path: widget-dependent string representation of the event location; e.g. for TreeView, a string representation of TreePath

-> Rectangle

backgroundArea: background area as passed to cellRendererRender

-> Rectangle

cellArea: cell area as passed to cellRendererRender

-> [CellRendererState]

flags: render flags

-> m Bool

Returns: True if the event was consumed/handled

Passes an activate event to the cell renderer for possible processing. Some cell renderers may use events; for example, CellRendererToggle toggles when it gets a mouse click.

getAlignedArea

cellRendererGetAlignedArea Source #

Arguments

:: (HasCallStack, MonadIO m, IsCellRenderer a, IsWidget b) 
=> a

cell: a CellRenderer instance

-> b

widget: the Widget this cell will be rendering to

-> [CellRendererState]

flags: render flags

-> Rectangle

cellArea: cell area which would be passed to cellRendererRender

-> m Rectangle 

Gets the aligned area used by cell inside cellArea. Used for finding the appropriate edit and focus rectangle.

Since: 3.0

getAlignment

cellRendererGetAlignment Source #

Arguments

:: (HasCallStack, MonadIO m, IsCellRenderer a) 
=> a

cell: A CellRenderer

-> m (Float, Float) 

Fills in xalign and yalign with the appropriate values of cell.

Since: 2.18

getFixedSize

cellRendererGetFixedSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsCellRenderer a) 
=> a

cell: A CellRenderer

-> m (Int32, Int32) 

Fills in width and height with the appropriate size of cell.

getPadding

cellRendererGetPadding Source #

Arguments

:: (HasCallStack, MonadIO m, IsCellRenderer a) 
=> a

cell: A CellRenderer

-> m (Int32, Int32) 

Fills in xpad and ypad with the appropriate values of cell.

Since: 2.18

getPreferredHeight

cellRendererGetPreferredHeight Source #

Arguments

:: (HasCallStack, MonadIO m, IsCellRenderer a, IsWidget b) 
=> a

cell: a CellRenderer instance

-> b

widget: the Widget this cell will be rendering to

-> m (Int32, Int32) 

Retreives a renderer’s natural size when rendered to widget.

Since: 3.0

getPreferredHeightForWidth

cellRendererGetPreferredHeightForWidth Source #

Arguments

:: (HasCallStack, MonadIO m, IsCellRenderer a, IsWidget b) 
=> a

cell: a CellRenderer instance

-> b

widget: the Widget this cell will be rendering to

-> Int32

width: the size which is available for allocation

-> m (Int32, Int32) 

Retreives a cell renderers’s minimum and natural height if it were rendered to widget with the specified width.

Since: 3.0

getPreferredSize

cellRendererGetPreferredSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsCellRenderer a, IsWidget b) 
=> a

cell: a CellRenderer instance

-> b

widget: the Widget this cell will be rendering to

-> m (Requisition, Requisition) 

Retrieves the minimum and natural size of a cell taking into account the widget’s preference for height-for-width management.

Since: 3.0

getPreferredWidth

cellRendererGetPreferredWidth Source #

Arguments

:: (HasCallStack, MonadIO m, IsCellRenderer a, IsWidget b) 
=> a

cell: a CellRenderer instance

-> b

widget: the Widget this cell will be rendering to

-> m (Int32, Int32) 

Retreives a renderer’s natural size when rendered to widget.

Since: 3.0

getPreferredWidthForHeight

cellRendererGetPreferredWidthForHeight Source #

Arguments

:: (HasCallStack, MonadIO m, IsCellRenderer a, IsWidget b) 
=> a

cell: a CellRenderer instance

-> b

widget: the Widget this cell will be rendering to

-> Int32

height: the size which is available for allocation

-> m (Int32, Int32) 

Retreives a cell renderers’s minimum and natural width if it were rendered to widget with the specified height.

Since: 3.0

getRequestMode

cellRendererGetRequestMode Source #

Arguments

:: (HasCallStack, MonadIO m, IsCellRenderer a) 
=> a

cell: a CellRenderer instance

-> m SizeRequestMode

Returns: The SizeRequestMode preferred by this renderer.

Gets whether the cell renderer prefers a height-for-width layout or a width-for-height layout.

Since: 3.0

getSensitive

cellRendererGetSensitive Source #

Arguments

:: (HasCallStack, MonadIO m, IsCellRenderer a) 
=> a

cell: A CellRenderer

-> m Bool

Returns: True if the cell renderer is sensitive

Returns the cell renderer’s sensitivity.

Since: 2.18

getSize

cellRendererGetSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsCellRenderer a, IsWidget b) 
=> a

cell: a CellRenderer

-> b

widget: the widget the renderer is rendering to

-> Maybe Rectangle

cellArea: The area a cell will be allocated, or Nothing

-> m (Int32, Int32, Int32, Int32) 

Deprecated: (Since version 3.0)Use cellRendererGetPreferredSize instead.

Obtains the width and height needed to render the cell. Used by view widgets to determine the appropriate size for the cell_area passed to cellRendererRender. If cellArea is not Nothing, fills in the x and y offsets (if set) of the cell relative to this location.

Please note that the values set in width and height, as well as those in xOffset and yOffset are inclusive of the xpad and ypad properties.

getState

cellRendererGetState Source #

Arguments

:: (HasCallStack, MonadIO m, IsCellRenderer a, IsWidget b) 
=> a

cell: a CellRenderer, or Nothing

-> Maybe b

widget: a Widget, or Nothing

-> [CellRendererState]

cellState: cell renderer state

-> m [StateFlags]

Returns: the widget state flags applying to cell

Translates the cell renderer state to StateFlags, based on the cell renderer and widget sensitivity, and the given CellRendererState.

Since: 3.0

getVisible

cellRendererGetVisible Source #

Arguments

:: (HasCallStack, MonadIO m, IsCellRenderer a) 
=> a

cell: A CellRenderer

-> m Bool

Returns: True if the cell renderer is visible

Returns the cell renderer’s visibility.

Since: 2.18

isActivatable

cellRendererIsActivatable Source #

Arguments

:: (HasCallStack, MonadIO m, IsCellRenderer a) 
=> a

cell: A CellRenderer

-> m Bool

Returns: True if the cell renderer can do anything when activated

Checks whether the cell renderer can do something when activated.

Since: 3.0

render

cellRendererRender Source #

Arguments

:: (HasCallStack, MonadIO m, IsCellRenderer a, IsWidget b) 
=> a

cell: a CellRenderer

-> Context

cr: a cairo context to draw to

-> b

widget: the widget owning window

-> Rectangle

backgroundArea: entire cell area (including tree expanders and maybe padding on the sides)

-> Rectangle

cellArea: area normally rendered by a cell renderer

-> [CellRendererState]

flags: flags that affect rendering

-> m () 

Invokes the virtual render function of the CellRenderer. The three passed-in rectangles are areas in cr. Most renderers will draw within cellArea; the xalign, yalign, xpad, and ypad fields of the CellRenderer should be honored with respect to cellArea. backgroundArea includes the blank space around the cell, and also the area containing the tree expander; so the backgroundArea rectangles for all cells tile to cover the entire window.

setAlignment

cellRendererSetAlignment Source #

Arguments

:: (HasCallStack, MonadIO m, IsCellRenderer a) 
=> a

cell: A CellRenderer

-> Float

xalign: the x alignment of the cell renderer

-> Float

yalign: the y alignment of the cell renderer

-> m () 

Sets the renderer’s alignment within its available space.

Since: 2.18

setFixedSize

cellRendererSetFixedSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsCellRenderer a) 
=> a

cell: A CellRenderer

-> Int32

width: the width of the cell renderer, or -1

-> Int32

height: the height of the cell renderer, or -1

-> m () 

Sets the renderer size to be explicit, independent of the properties set.

setPadding

cellRendererSetPadding Source #

Arguments

:: (HasCallStack, MonadIO m, IsCellRenderer a) 
=> a

cell: A CellRenderer

-> Int32

xpad: the x padding of the cell renderer

-> Int32

ypad: the y padding of the cell renderer

-> m () 

Sets the renderer’s padding.

Since: 2.18

setSensitive

cellRendererSetSensitive Source #

Arguments

:: (HasCallStack, MonadIO m, IsCellRenderer a) 
=> a

cell: A CellRenderer

-> Bool

sensitive: the sensitivity of the cell

-> m () 

Sets the cell renderer’s sensitivity.

Since: 2.18

setVisible

cellRendererSetVisible Source #

Arguments

:: (HasCallStack, MonadIO m, IsCellRenderer a) 
=> a

cell: A CellRenderer

-> Bool

visible: the visibility of the cell

-> m () 

Sets the cell renderer’s visibility.

Since: 2.18

startEditing

cellRendererStartEditing Source #

Arguments

:: (HasCallStack, MonadIO m, IsCellRenderer a, IsWidget b) 
=> a

cell: a CellRenderer

-> Maybe Event

event: a Event

-> b

widget: widget that received the event

-> Text

path: widget-dependent string representation of the event location; e.g. for TreeView, a string representation of TreePath

-> Rectangle

backgroundArea: background area as passed to cellRendererRender

-> Rectangle

cellArea: cell area as passed to cellRendererRender

-> [CellRendererState]

flags: render flags

-> m (Maybe CellEditable)

Returns: A new CellEditable for editing this cell, or Nothing if editing is not possible

Starts editing the contents of this cell, through a new CellEditable widget created by the CellRendererClass.start_editing virtual function.

stopEditing

cellRendererStopEditing Source #

Arguments

:: (HasCallStack, MonadIO m, IsCellRenderer a) 
=> a

cell: A CellRenderer

-> Bool

canceled: True if the editing has been canceled

-> m () 

Informs the cell renderer that the editing is stopped. If canceled is True, the cell renderer will emit the editingCanceled signal.

This function should be called by cell renderer implementations in response to the editingDone signal of CellEditable.

Since: 2.6

Properties

cellBackground

No description available in the introspection data.

clearCellRendererCellBackground :: (MonadIO m, IsCellRenderer o) => o -> m () Source #

Set the value of the “cell-background” property to Nothing. When overloading is enabled, this is equivalent to

clear #cellBackground

constructCellRendererCellBackground :: IsCellRenderer o => Text -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “cell-background” property. This is rarely needed directly, but it is used by new.

setCellRendererCellBackground :: (MonadIO m, IsCellRenderer o) => o -> Text -> m () Source #

Set the value of the “cell-background” property. When overloading is enabled, this is equivalent to

set cellRenderer [ #cellBackground := value ]

cellBackgroundGdk

Cell background as a Color

clearCellRendererCellBackgroundGdk :: (MonadIO m, IsCellRenderer o) => o -> m () Source #

Set the value of the “cell-background-gdk” property to Nothing. When overloading is enabled, this is equivalent to

clear #cellBackgroundGdk

constructCellRendererCellBackgroundGdk :: IsCellRenderer o => Color -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “cell-background-gdk” property. This is rarely needed directly, but it is used by new.

getCellRendererCellBackgroundGdk :: (MonadIO m, IsCellRenderer o) => o -> m (Maybe Color) Source #

Get the value of the “cell-background-gdk” property. When overloading is enabled, this is equivalent to

get cellRenderer #cellBackgroundGdk

setCellRendererCellBackgroundGdk :: (MonadIO m, IsCellRenderer o) => o -> Color -> m () Source #

Set the value of the “cell-background-gdk” property. When overloading is enabled, this is equivalent to

set cellRenderer [ #cellBackgroundGdk := value ]

cellBackgroundRgba

Cell background as a RGBA

Since: 3.0

clearCellRendererCellBackgroundRgba :: (MonadIO m, IsCellRenderer o) => o -> m () Source #

Set the value of the “cell-background-rgba” property to Nothing. When overloading is enabled, this is equivalent to

clear #cellBackgroundRgba

constructCellRendererCellBackgroundRgba :: IsCellRenderer o => RGBA -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “cell-background-rgba” property. This is rarely needed directly, but it is used by new.

getCellRendererCellBackgroundRgba :: (MonadIO m, IsCellRenderer o) => o -> m (Maybe RGBA) Source #

Get the value of the “cell-background-rgba” property. When overloading is enabled, this is equivalent to

get cellRenderer #cellBackgroundRgba

setCellRendererCellBackgroundRgba :: (MonadIO m, IsCellRenderer o) => o -> RGBA -> m () Source #

Set the value of the “cell-background-rgba” property. When overloading is enabled, this is equivalent to

set cellRenderer [ #cellBackgroundRgba := value ]

cellBackgroundSet

No description available in the introspection data.

constructCellRendererCellBackgroundSet :: IsCellRenderer o => Bool -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “cell-background-set” property. This is rarely needed directly, but it is used by new.

getCellRendererCellBackgroundSet :: (MonadIO m, IsCellRenderer o) => o -> m Bool Source #

Get the value of the “cell-background-set” property. When overloading is enabled, this is equivalent to

get cellRenderer #cellBackgroundSet

setCellRendererCellBackgroundSet :: (MonadIO m, IsCellRenderer o) => o -> Bool -> m () Source #

Set the value of the “cell-background-set” property. When overloading is enabled, this is equivalent to

set cellRenderer [ #cellBackgroundSet := value ]

editing

No description available in the introspection data.

getCellRendererEditing :: (MonadIO m, IsCellRenderer o) => o -> m Bool Source #

Get the value of the “editing” property. When overloading is enabled, this is equivalent to

get cellRenderer #editing

height

No description available in the introspection data.

constructCellRendererHeight :: IsCellRenderer o => Int32 -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “height” property. This is rarely needed directly, but it is used by new.

getCellRendererHeight :: (MonadIO m, IsCellRenderer o) => o -> m Int32 Source #

Get the value of the “height” property. When overloading is enabled, this is equivalent to

get cellRenderer #height

setCellRendererHeight :: (MonadIO m, IsCellRenderer o) => o -> Int32 -> m () Source #

Set the value of the “height” property. When overloading is enabled, this is equivalent to

set cellRenderer [ #height := value ]

isExpanded

No description available in the introspection data.

constructCellRendererIsExpanded :: IsCellRenderer o => Bool -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “is-expanded” property. This is rarely needed directly, but it is used by new.

getCellRendererIsExpanded :: (MonadIO m, IsCellRenderer o) => o -> m Bool Source #

Get the value of the “is-expanded” property. When overloading is enabled, this is equivalent to

get cellRenderer #isExpanded

setCellRendererIsExpanded :: (MonadIO m, IsCellRenderer o) => o -> Bool -> m () Source #

Set the value of the “is-expanded” property. When overloading is enabled, this is equivalent to

set cellRenderer [ #isExpanded := value ]

isExpander

No description available in the introspection data.

constructCellRendererIsExpander :: IsCellRenderer o => Bool -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “is-expander” property. This is rarely needed directly, but it is used by new.

getCellRendererIsExpander :: (MonadIO m, IsCellRenderer o) => o -> m Bool Source #

Get the value of the “is-expander” property. When overloading is enabled, this is equivalent to

get cellRenderer #isExpander

setCellRendererIsExpander :: (MonadIO m, IsCellRenderer o) => o -> Bool -> m () Source #

Set the value of the “is-expander” property. When overloading is enabled, this is equivalent to

set cellRenderer [ #isExpander := value ]

mode

No description available in the introspection data.

constructCellRendererMode :: IsCellRenderer o => CellRendererMode -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “mode” property. This is rarely needed directly, but it is used by new.

getCellRendererMode :: (MonadIO m, IsCellRenderer o) => o -> m CellRendererMode Source #

Get the value of the “mode” property. When overloading is enabled, this is equivalent to

get cellRenderer #mode

setCellRendererMode :: (MonadIO m, IsCellRenderer o) => o -> CellRendererMode -> m () Source #

Set the value of the “mode” property. When overloading is enabled, this is equivalent to

set cellRenderer [ #mode := value ]

sensitive

No description available in the introspection data.

constructCellRendererSensitive :: IsCellRenderer o => Bool -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “sensitive” property. This is rarely needed directly, but it is used by new.

getCellRendererSensitive :: (MonadIO m, IsCellRenderer o) => o -> m Bool Source #

Get the value of the “sensitive” property. When overloading is enabled, this is equivalent to

get cellRenderer #sensitive

setCellRendererSensitive :: (MonadIO m, IsCellRenderer o) => o -> Bool -> m () Source #

Set the value of the “sensitive” property. When overloading is enabled, this is equivalent to

set cellRenderer [ #sensitive := value ]

visible

No description available in the introspection data.

constructCellRendererVisible :: IsCellRenderer o => Bool -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “visible” property. This is rarely needed directly, but it is used by new.

getCellRendererVisible :: (MonadIO m, IsCellRenderer o) => o -> m Bool Source #

Get the value of the “visible” property. When overloading is enabled, this is equivalent to

get cellRenderer #visible

setCellRendererVisible :: (MonadIO m, IsCellRenderer o) => o -> Bool -> m () Source #

Set the value of the “visible” property. When overloading is enabled, this is equivalent to

set cellRenderer [ #visible := value ]

width

No description available in the introspection data.

constructCellRendererWidth :: IsCellRenderer o => Int32 -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “width” property. This is rarely needed directly, but it is used by new.

getCellRendererWidth :: (MonadIO m, IsCellRenderer o) => o -> m Int32 Source #

Get the value of the “width” property. When overloading is enabled, this is equivalent to

get cellRenderer #width

setCellRendererWidth :: (MonadIO m, IsCellRenderer o) => o -> Int32 -> m () Source #

Set the value of the “width” property. When overloading is enabled, this is equivalent to

set cellRenderer [ #width := value ]

xalign

No description available in the introspection data.

constructCellRendererXalign :: IsCellRenderer o => Float -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “xalign” property. This is rarely needed directly, but it is used by new.

getCellRendererXalign :: (MonadIO m, IsCellRenderer o) => o -> m Float Source #

Get the value of the “xalign” property. When overloading is enabled, this is equivalent to

get cellRenderer #xalign

setCellRendererXalign :: (MonadIO m, IsCellRenderer o) => o -> Float -> m () Source #

Set the value of the “xalign” property. When overloading is enabled, this is equivalent to

set cellRenderer [ #xalign := value ]

xpad

No description available in the introspection data.

constructCellRendererXpad :: IsCellRenderer o => Word32 -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “xpad” property. This is rarely needed directly, but it is used by new.

getCellRendererXpad :: (MonadIO m, IsCellRenderer o) => o -> m Word32 Source #

Get the value of the “xpad” property. When overloading is enabled, this is equivalent to

get cellRenderer #xpad

setCellRendererXpad :: (MonadIO m, IsCellRenderer o) => o -> Word32 -> m () Source #

Set the value of the “xpad” property. When overloading is enabled, this is equivalent to

set cellRenderer [ #xpad := value ]

yalign

No description available in the introspection data.

constructCellRendererYalign :: IsCellRenderer o => Float -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “yalign” property. This is rarely needed directly, but it is used by new.

getCellRendererYalign :: (MonadIO m, IsCellRenderer o) => o -> m Float Source #

Get the value of the “yalign” property. When overloading is enabled, this is equivalent to

get cellRenderer #yalign

setCellRendererYalign :: (MonadIO m, IsCellRenderer o) => o -> Float -> m () Source #

Set the value of the “yalign” property. When overloading is enabled, this is equivalent to

set cellRenderer [ #yalign := value ]

ypad

No description available in the introspection data.

constructCellRendererYpad :: IsCellRenderer o => Word32 -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “ypad” property. This is rarely needed directly, but it is used by new.

getCellRendererYpad :: (MonadIO m, IsCellRenderer o) => o -> m Word32 Source #

Get the value of the “ypad” property. When overloading is enabled, this is equivalent to

get cellRenderer #ypad

setCellRendererYpad :: (MonadIO m, IsCellRenderer o) => o -> Word32 -> m () Source #

Set the value of the “ypad” property. When overloading is enabled, this is equivalent to

set cellRenderer [ #ypad := value ]

Signals

editingCanceled

type C_CellRendererEditingCanceledCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type CellRendererEditingCanceledCallback = IO () Source #

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.

See also: cellRendererStopEditing.

Since: 2.4

afterCellRendererEditingCanceled :: (IsCellRenderer a, MonadIO m) => a -> CellRendererEditingCanceledCallback -> m SignalHandlerId Source #

Connect a signal handler for the editingCanceled signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after cellRenderer #editingCanceled callback

onCellRendererEditingCanceled :: (IsCellRenderer a, MonadIO m) => a -> CellRendererEditingCanceledCallback -> m SignalHandlerId Source #

Connect a signal handler for the editingCanceled signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on cellRenderer #editingCanceled callback

editingStarted

type C_CellRendererEditingStartedCallback = Ptr () -> Ptr CellEditable -> CString -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type CellRendererEditingStartedCallback Source #

Arguments

 = CellEditable

editable: the CellEditable

-> Text

path: the path identifying the edited cell

-> IO () 

This signal gets emitted when a cell starts to be edited. The intended use of this signal is to do special setup on editable, e.g. adding a EntryCompletion or setting up additional columns in a ComboBox.

See cellEditableStartEditing for information on the lifecycle of the editable and a way to do setup that doesn’t depend on the renderer.

Note that GTK+ doesn't guarantee that cell renderers will continue to use the same kind of widget for editing in future releases, therefore you should check the type of editable before doing any specific setup, as in the following example:

C code

static void
text_editing_started (GtkCellRenderer *cell,
                      GtkCellEditable *editable,
                      const gchar     *path,
                      gpointer         data)
{
  if (GTK_IS_ENTRY (editable))
    {
      GtkEntry *entry = GTK_ENTRY (editable);
      
      // ... create a GtkEntryCompletion
      
      gtk_entry_set_completion (entry, completion);
    }
}

Since: 2.6

afterCellRendererEditingStarted :: (IsCellRenderer a, MonadIO m) => a -> CellRendererEditingStartedCallback -> m SignalHandlerId Source #

Connect a signal handler for the editingStarted signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after cellRenderer #editingStarted callback

onCellRendererEditingStarted :: (IsCellRenderer a, MonadIO m) => a -> CellRendererEditingStartedCallback -> m SignalHandlerId Source #

Connect a signal handler for the editingStarted signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on cellRenderer #editingStarted callback