gtk4::prelude

Trait CellEditableExt

Source
pub trait CellEditableExt:
    IsA<CellEditable>
    + Sealed
    + 'static {
    // Provided methods
    fn editing_done(&self) { ... }
    fn remove_widget(&self) { ... }
    fn start_editing(&self, event: Option<impl AsRef<Event>>) { ... }
    fn is_editing_canceled(&self) -> bool { ... }
    fn set_editing_canceled(&self, editing_canceled: bool) { ... }
    fn connect_editing_done<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId { ... }
    fn connect_remove_widget<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId { ... }
    fn connect_editing_canceled_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId { ... }
}
๐Ÿ‘ŽDeprecated: Since 4.10
Expand description

Trait containing all CellEditable methods.

ยงImplementors

CellEditable, ComboBoxText, ComboBox, Entry, SpinButton

Provided Methodsยง

Source

fn editing_done(&self)

๐Ÿ‘ŽDeprecated: Since 4.10

Emits the GtkCellEditable::editing-done signal.

ยงDeprecated since 4.10
Source

fn remove_widget(&self)

๐Ÿ‘ŽDeprecated: Since 4.10

Emits the GtkCellEditable::remove-widget signal.

ยงDeprecated since 4.10
Source

fn start_editing(&self, event: Option<impl AsRef<Event>>)

๐Ÿ‘ŽDeprecated: Since 4.10

Begins editing on a @self.

The CellRenderer for the cell creates and returns a CellEditable from gtk_cell_renderer_start_editing(), configured for the CellRenderer type.

gtk_cell_editable_start_editing() can then set up @self suitably for editing a cell, e.g. making the Esc key emit GtkCellEditable::editing-done.

Note that the @self is created on-demand for the current edit; its lifetime is temporary and does not persist across other edits and/or cells.

ยงevent

The gdk::Event that began the editing process, or None if editing was initiated programmatically

Source

fn is_editing_canceled(&self) -> bool

๐Ÿ‘ŽDeprecated: Since 4.10

Indicates whether editing on the cell has been canceled.

Source

fn set_editing_canceled(&self, editing_canceled: bool)

๐Ÿ‘ŽDeprecated: Since 4.10

Indicates whether editing on the cell has been canceled.

Source

fn connect_editing_done<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

๐Ÿ‘ŽDeprecated: Since 4.10

This signal is a sign for the cell renderer to update its value from the @cell_editable.

Implementations of CellEditable are responsible for emitting this signal when they are done editing, e.g. Entry emits this signal when the user presses Enter. Typical things to do in a handler for ::editing-done are to capture the edited value, disconnect the @cell_editable from signals on the CellRenderer, etc.

gtk_cell_editable_editing_done() is a convenience method for emitting GtkCellEditable::editing-done.

Source

fn connect_remove_widget<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

๐Ÿ‘ŽDeprecated: Since 4.10

This signal is meant to indicate that the cell is finished editing, and the @cell_editable widget is being removed and may subsequently be destroyed.

Implementations of CellEditable are responsible for emitting this signal when they are done editing. It must be emitted after the GtkCellEditable::editing-done signal, to give the cell renderer a chance to update the cellโ€™s value before the widget is removed.

gtk_cell_editable_remove_widget() is a convenience method for emitting GtkCellEditable::remove-widget.

Source

fn connect_editing_canceled_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

๐Ÿ‘ŽDeprecated: Since 4.10

Dyn Compatibilityยง

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementorsยง