Skip to main content

CellRendererExt

Trait CellRendererExt 

Source
pub trait CellRendererExt: IsA<CellRenderer> + 'static {
Show 63 methods // Provided methods fn activate( &self, event: impl AsRef<Event>, widget: &impl IsA<Widget>, path: &str, background_area: &Rectangle, cell_area: &Rectangle, flags: CellRendererState, ) -> bool { ... } fn aligned_area( &self, widget: &impl IsA<Widget>, flags: CellRendererState, cell_area: &Rectangle, ) -> Rectangle { ... } fn alignment(&self) -> (f32, f32) { ... } fn fixed_size(&self) -> (i32, i32) { ... } fn is_expanded(&self) -> bool { ... } fn is_expander(&self) -> bool { ... } fn padding(&self) -> (i32, i32) { ... } fn preferred_height(&self, widget: &impl IsA<Widget>) -> (i32, i32) { ... } fn preferred_height_for_width( &self, widget: &impl IsA<Widget>, width: i32, ) -> (i32, i32) { ... } fn preferred_size( &self, widget: &impl IsA<Widget>, ) -> (Requisition, Requisition) { ... } fn preferred_width(&self, widget: &impl IsA<Widget>) -> (i32, i32) { ... } fn preferred_width_for_height( &self, widget: &impl IsA<Widget>, height: i32, ) -> (i32, i32) { ... } fn request_mode(&self) -> SizeRequestMode { ... } fn is_sensitive(&self) -> bool { ... } fn state( &self, widget: Option<&impl IsA<Widget>>, cell_state: CellRendererState, ) -> StateFlags { ... } fn is_visible(&self) -> bool { ... } fn is_activatable(&self) -> bool { ... } fn set_alignment(&self, xalign: f32, yalign: f32) { ... } fn set_fixed_size(&self, width: i32, height: i32) { ... } fn set_is_expanded(&self, is_expanded: bool) { ... } fn set_is_expander(&self, is_expander: bool) { ... } fn set_padding(&self, xpad: i32, ypad: i32) { ... } fn set_sensitive(&self, sensitive: bool) { ... } fn set_visible(&self, visible: bool) { ... } fn snapshot( &self, snapshot: &impl IsA<Snapshot>, widget: &impl IsA<Widget>, background_area: &Rectangle, cell_area: &Rectangle, flags: CellRendererState, ) { ... } fn start_editing( &self, event: Option<impl AsRef<Event>>, widget: &impl IsA<Widget>, path: &str, background_area: &Rectangle, cell_area: &Rectangle, flags: CellRendererState, ) -> Option<CellEditable> { ... } fn stop_editing(&self, canceled: bool) { ... } fn set_cell_background(&self, cell_background: Option<&str>) { ... } fn cell_background_rgba(&self) -> Option<RGBA> { ... } fn set_cell_background_rgba(&self, cell_background_rgba: Option<&RGBA>) { ... } fn is_cell_background_set(&self) -> bool { ... } fn is_editing(&self) -> bool { ... } fn height(&self) -> i32 { ... } fn set_height(&self, height: i32) { ... } fn mode(&self) -> CellRendererMode { ... } fn set_mode(&self, mode: CellRendererMode) { ... } fn width(&self) -> i32 { ... } fn set_width(&self, width: i32) { ... } fn xalign(&self) -> f32 { ... } fn set_xalign(&self, xalign: f32) { ... } fn xpad(&self) -> u32 { ... } fn set_xpad(&self, xpad: u32) { ... } fn yalign(&self) -> f32 { ... } fn set_yalign(&self, yalign: f32) { ... } fn ypad(&self) -> u32 { ... } fn set_ypad(&self, ypad: u32) { ... } fn connect_editing_canceled<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_editing_started<F: Fn(&Self, &CellEditable, TreePath) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_cell_background_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_cell_background_rgba_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_cell_background_set_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_editing_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_height_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_is_expanded_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_is_expander_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_mode_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_sensitive_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_visible_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_width_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_xalign_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_xpad_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_yalign_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_ypad_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... }
}
πŸ‘ŽDeprecated:

Since 4.10

Expand description

Provided MethodsΒ§

Source

fn activate( &self, event: impl AsRef<Event>, widget: &impl IsA<Widget>, path: &str, background_area: &Rectangle, cell_area: &Rectangle, flags: CellRendererState, ) -> bool

πŸ‘ŽDeprecated:

Since 4.10

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.

Β§Deprecated since 4.10
Β§event

a gdk::Event

Β§widget

widget that received the event

Β§path

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

Β§background_area

background area as passed to gtk_cell_renderer_render()

Β§cell_area

cell area as passed to gtk_cell_renderer_render()

Β§flags

render flags

Β§Returns

true if the event was consumed/handled

Source

fn aligned_area( &self, widget: &impl IsA<Widget>, flags: CellRendererState, cell_area: &Rectangle, ) -> Rectangle

πŸ‘ŽDeprecated:

Since 4.10

Gets the aligned area used by @self inside @cell_area. Used for finding the appropriate edit and focus rectangle.

Β§Deprecated since 4.10
Β§widget

the Widget this cell will be rendering to

Β§flags

render flags

Β§cell_area

cell area which would be passed to gtk_cell_renderer_render()

Β§Returns
Β§aligned_area

the return location for the space inside @cell_area that would actually be used to render.

Source

fn alignment(&self) -> (f32, f32)

πŸ‘ŽDeprecated:

Since 4.10

Fills in @xalign and @yalign with the appropriate values of @self.

Β§Deprecated since 4.10
Β§Returns
Β§xalign

location to fill in with the x alignment of the cell

Β§yalign

location to fill in with the y alignment of the cell

Source

fn fixed_size(&self) -> (i32, i32)

πŸ‘ŽDeprecated:

Since 4.10

Fills in @width and @height with the appropriate size of @self.

Β§Deprecated since 4.10
Β§Returns
Β§width

location to fill in with the fixed width of the cell

Β§height

location to fill in with the fixed height of the cell

Source

fn is_expanded(&self) -> bool

πŸ‘ŽDeprecated:

Since 4.10

Checks whether the given CellRenderer is expanded.

Β§Deprecated since 4.10
Β§Returns

true if the cell renderer is expanded

Source

fn is_expander(&self) -> bool

πŸ‘ŽDeprecated:

Since 4.10

Checks whether the given CellRenderer is an expander.

Β§Deprecated since 4.10
Β§Returns

true if @self is an expander, and false otherwise

Source

fn padding(&self) -> (i32, i32)

πŸ‘ŽDeprecated:

Since 4.10

Fills in @xpad and @ypad with the appropriate values of @self.

Β§Deprecated since 4.10
Β§Returns
Β§xpad

location to fill in with the x padding of the cell

Β§ypad

location to fill in with the y padding of the cell

Source

fn preferred_height(&self, widget: &impl IsA<Widget>) -> (i32, i32)

πŸ‘ŽDeprecated:

Since 4.10

s natural size when rendered to @widget.

Β§Deprecated since 4.10
Β§widget

the Widget this cell will be rendering to

Β§Returns
Β§minimum_size

location to store the minimum size

Β§natural_size

location to store the natural size

Source

fn preferred_height_for_width( &self, widget: &impl IsA<Widget>, width: i32, ) -> (i32, i32)

πŸ‘ŽDeprecated:

Since 4.10

s minimum and natural height if it were rendered to @widget with the specified @width.

Β§Deprecated since 4.10
Β§widget

the Widget this cell will be rendering to

Β§width

the size which is available for allocation

Β§Returns
Β§minimum_height

location for storing the minimum size

Β§natural_height

location for storing the preferred size

Source

fn preferred_size( &self, widget: &impl IsA<Widget>, ) -> (Requisition, Requisition)

πŸ‘ŽDeprecated:

Since 4.10

s preference for height-for-width management.

Β§Deprecated since 4.10
Β§widget

the Widget this cell will be rendering to

Β§Returns
Β§minimum_size

location for storing the minimum size

Β§natural_size

location for storing the natural size

Source

fn preferred_width(&self, widget: &impl IsA<Widget>) -> (i32, i32)

πŸ‘ŽDeprecated:

Since 4.10

s natural size when rendered to @widget.

Β§Deprecated since 4.10
Β§widget

the Widget this cell will be rendering to

Β§Returns
Β§minimum_size

location to store the minimum size

Β§natural_size

location to store the natural size

Source

fn preferred_width_for_height( &self, widget: &impl IsA<Widget>, height: i32, ) -> (i32, i32)

πŸ‘ŽDeprecated:

Since 4.10

s minimum and natural width if it were rendered to @widget with the specified @height.

Β§Deprecated since 4.10
Β§widget

the Widget this cell will be rendering to

Β§height

the size which is available for allocation

Β§Returns
Β§minimum_width

location for storing the minimum size

Β§natural_width

location for storing the preferred size

Source

fn request_mode(&self) -> SizeRequestMode

πŸ‘ŽDeprecated:

Since 4.10

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

Β§Deprecated since 4.10
Β§Returns

The SizeRequestMode preferred by this renderer.

Source

fn is_sensitive(&self) -> bool

πŸ‘ŽDeprecated:

Since 4.10

s sensitivity.

Β§Deprecated since 4.10
Β§Returns

true if the cell renderer is sensitive

Source

fn state( &self, widget: Option<&impl IsA<Widget>>, cell_state: CellRendererState, ) -> StateFlags

πŸ‘ŽDeprecated:

Since 4.10

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

Β§Deprecated since 4.10
Β§widget

a Widget

Β§cell_state

cell renderer state

Β§Returns

the widget state flags applying to @self

Source

fn is_visible(&self) -> bool

πŸ‘ŽDeprecated:

Since 4.10

s visibility.

Β§Deprecated since 4.10
Β§Returns

true if the cell renderer is visible

Source

fn is_activatable(&self) -> bool

πŸ‘ŽDeprecated:

Since 4.10

Checks whether the cell renderer can do something when activated.

Β§Deprecated since 4.10
Β§Returns

true if the cell renderer can do anything when activated

Source

fn set_alignment(&self, xalign: f32, yalign: f32)

πŸ‘ŽDeprecated:

Since 4.10

s alignment within its available space.

Β§Deprecated since 4.10
Β§xalign

the x alignment of the cell renderer

Β§yalign

the y alignment of the cell renderer

Source

fn set_fixed_size(&self, width: i32, height: i32)

πŸ‘ŽDeprecated:

Since 4.10

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

Β§Deprecated since 4.10
Β§width

the width of the cell renderer, or -1

Β§height

the height of the cell renderer, or -1

Source

fn set_is_expanded(&self, is_expanded: bool)

πŸ‘ŽDeprecated:

Since 4.10

Sets whether the given CellRenderer is expanded.

Β§Deprecated since 4.10
Β§is_expanded

whether @self should be expanded

Source

fn set_is_expander(&self, is_expander: bool)

πŸ‘ŽDeprecated:

Since 4.10

Sets whether the given CellRenderer is an expander.

Β§Deprecated since 4.10
Β§is_expander

whether @self is an expander

Source

fn set_padding(&self, xpad: i32, ypad: i32)

πŸ‘ŽDeprecated:

Since 4.10

s padding.

Β§Deprecated since 4.10
Β§xpad

the x padding of the cell renderer

Β§ypad

the y padding of the cell renderer

Source

fn set_sensitive(&self, sensitive: bool)

πŸ‘ŽDeprecated:

Since 4.10

s sensitivity.

Β§Deprecated since 4.10
Β§sensitive

the sensitivity of the cell

Source

fn set_visible(&self, visible: bool)

πŸ‘ŽDeprecated:

Since 4.10

s visibility.

Β§Deprecated since 4.10
Β§visible

the visibility of the cell

Source

fn snapshot( &self, snapshot: &impl IsA<Snapshot>, widget: &impl IsA<Widget>, background_area: &Rectangle, cell_area: &Rectangle, flags: CellRendererState, )

πŸ‘ŽDeprecated:

Since 4.10

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

Β§Deprecated since 4.10
Β§snapshot

a Snapshot to draw to

Β§widget

the widget owning @window

Β§background_area

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

Β§cell_area

area normally rendered by a cell renderer

Β§flags

flags that affect rendering

Source

fn start_editing( &self, event: Option<impl AsRef<Event>>, widget: &impl IsA<Widget>, path: &str, background_area: &Rectangle, cell_area: &Rectangle, flags: CellRendererState, ) -> Option<CellEditable>

πŸ‘ŽDeprecated:

Since 4.10

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

Β§Deprecated since 4.10
Β§event

a gdk::Event

Β§widget

widget that received the event

Β§path

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

Β§background_area

background area as passed to gtk_cell_renderer_render()

Β§cell_area

cell area as passed to gtk_cell_renderer_render()

Β§flags

render flags

Β§Returns

A new CellEditable for editing this @self, or None if editing is not possible

Source

fn stop_editing(&self, canceled: bool)

πŸ‘ŽDeprecated:

Since 4.10

Informs the cell renderer that the editing is stopped. If @canceled is true, the cell renderer will emit the CellRenderer::editing-canceled signal.

This function should be called by cell renderer implementations in response to the GtkCellEditable::editing-done signal of CellEditable.

Β§Deprecated since 4.10
Β§canceled

true if the editing has been canceled

Source

fn set_cell_background(&self, cell_background: Option<&str>)

πŸ‘ŽDeprecated:

Since 4.10

Source

fn cell_background_rgba(&self) -> Option<RGBA>

πŸ‘ŽDeprecated:

Since 4.10

Cell background as a gdk::RGBA

Source

fn set_cell_background_rgba(&self, cell_background_rgba: Option<&RGBA>)

πŸ‘ŽDeprecated:

Since 4.10

Cell background as a gdk::RGBA

Source

fn is_cell_background_set(&self) -> bool

πŸ‘ŽDeprecated:

Since 4.10

Source

fn is_editing(&self) -> bool

πŸ‘ŽDeprecated:

Since 4.10

Source

fn height(&self) -> i32

πŸ‘ŽDeprecated:

Since 4.10

Source

fn set_height(&self, height: i32)

πŸ‘ŽDeprecated:

Since 4.10

Source

fn mode(&self) -> CellRendererMode

πŸ‘ŽDeprecated:

Since 4.10

Source

fn set_mode(&self, mode: CellRendererMode)

πŸ‘ŽDeprecated:

Since 4.10

Source

fn width(&self) -> i32

πŸ‘ŽDeprecated:

Since 4.10

Source

fn set_width(&self, width: i32)

πŸ‘ŽDeprecated:

Since 4.10

Source

fn xalign(&self) -> f32

πŸ‘ŽDeprecated:

Since 4.10

Source

fn set_xalign(&self, xalign: f32)

πŸ‘ŽDeprecated:

Since 4.10

Source

fn xpad(&self) -> u32

πŸ‘ŽDeprecated:

Since 4.10

Source

fn set_xpad(&self, xpad: u32)

πŸ‘ŽDeprecated:

Since 4.10

Source

fn yalign(&self) -> f32

πŸ‘ŽDeprecated:

Since 4.10

Source

fn set_yalign(&self, yalign: f32)

πŸ‘ŽDeprecated:

Since 4.10

Source

fn ypad(&self) -> u32

πŸ‘ŽDeprecated:

Since 4.10

Source

fn set_ypad(&self, ypad: u32)

πŸ‘ŽDeprecated:

Since 4.10

Source

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

πŸ‘ŽDeprecated:

Since 4.10

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: gtk_cell_renderer_stop_editing().

Source

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

πŸ‘ŽDeprecated:

Since 4.10

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:

⚠️ The following code is in c ⚠️

static void
text_editing_started (GtkCellRenderer *cell,
                      GtkCellEditable *editable,
                      const char      *path,
                      gpointer         data)
{
  if (GTK_IS_ENTRY (editable))
    {
      GtkEntry *entry = GTK_ENTRY (editable);

      // ... create a GtkEntryCompletion

      gtk_entry_set_completion (entry, completion);
    }
}
Β§editable

the CellEditable

Β§path

the path identifying the edited cell

Source

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

πŸ‘ŽDeprecated:

Since 4.10

Source

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

πŸ‘ŽDeprecated:

Since 4.10

Source

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

πŸ‘ŽDeprecated:

Since 4.10

Source

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

πŸ‘ŽDeprecated:

Since 4.10

Source

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

πŸ‘ŽDeprecated:

Since 4.10

Source

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

πŸ‘ŽDeprecated:

Since 4.10

Source

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

πŸ‘ŽDeprecated:

Since 4.10

Source

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

πŸ‘ŽDeprecated:

Since 4.10

Source

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

πŸ‘ŽDeprecated:

Since 4.10

Source

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

πŸ‘ŽDeprecated:

Since 4.10

Source

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

πŸ‘ŽDeprecated:

Since 4.10

Source

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

πŸ‘ŽDeprecated:

Since 4.10

Source

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

πŸ‘ŽDeprecated:

Since 4.10

Source

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

πŸ‘ŽDeprecated:

Since 4.10

Source

fn connect_ypad_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".

ImplementorsΒ§