Trait gtk4::subclass::cell_renderer::CellRendererImpl
source · pub trait CellRendererImpl: CellRendererImplExt + ObjectImpl {
// Provided methods
fn activate<P: IsA<Widget>>(
&self,
event: Option<&Event>,
widget: &P,
path: &str,
background_area: &Rectangle,
cell_area: &Rectangle,
flags: CellRendererState
) -> bool { ... }
fn editing_canceled(&self) { ... }
fn editing_started(&self, editable: &CellEditable, path: &str) { ... }
fn aligned_area<P: IsA<Widget>>(
&self,
widget: &P,
flags: CellRendererState,
cell_area: &Rectangle
) -> Rectangle { ... }
fn preferred_height_for_width<P: IsA<Widget>>(
&self,
widget: &P,
width: i32
) -> (i32, i32) { ... }
fn preferred_height<P: IsA<Widget>>(&self, widget: &P) -> (i32, i32) { ... }
fn preferred_width_for_height<P: IsA<Widget>>(
&self,
widget: &P,
height: i32
) -> (i32, i32) { ... }
fn preferred_width<P: IsA<Widget>>(&self, widget: &P) -> (i32, i32) { ... }
fn request_mode(&self) -> SizeRequestMode { ... }
fn snapshot<P: IsA<Widget>>(
&self,
snapshot: &Snapshot,
widget: &P,
background_area: &Rectangle,
cell_area: &Rectangle,
flags: CellRendererState
) { ... }
fn start_editing<P: IsA<Widget>>(
&self,
event: Option<&Event>,
widget: &P,
path: &str,
background_area: &Rectangle,
cell_area: &Rectangle,
flags: CellRendererState
) -> Option<CellEditable> { ... }
}
Provided Methods§
sourcefn activate<P: IsA<Widget>>(
&self,
event: Option<&Event>,
widget: &P,
path: &str,
background_area: &Rectangle,
cell_area: &Rectangle,
flags: CellRendererState
) -> bool
fn activate<P: IsA<Widget>>( &self, event: Option<&Event>, widget: &P, path: &str, background_area: &Rectangle, cell_area: &Rectangle, flags: CellRendererState ) -> bool
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
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
sourcefn editing_canceled(&self)
fn editing_canceled(&self)
sourcefn editing_started(&self, editable: &CellEditable, path: &str)
fn editing_started(&self, editable: &CellEditable, path: &str)
sourcefn aligned_area<P: IsA<Widget>>(
&self,
widget: &P,
flags: CellRendererState,
cell_area: &Rectangle
) -> Rectangle
fn aligned_area<P: IsA<Widget>>( &self, widget: &P, flags: CellRendererState, cell_area: &Rectangle ) -> Rectangle
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.
sourcefn preferred_height_for_width<P: IsA<Widget>>(
&self,
widget: &P,
width: i32
) -> (i32, i32)
fn preferred_height_for_width<P: IsA<Widget>>( &self, widget: &P, width: i32 ) -> (i32, i32)
Retrieves a cell renderers’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
sourcefn preferred_height<P: IsA<Widget>>(&self, widget: &P) -> (i32, i32)
fn preferred_height<P: IsA<Widget>>(&self, widget: &P) -> (i32, i32)
Retrieves a renderer’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
sourcefn preferred_width_for_height<P: IsA<Widget>>(
&self,
widget: &P,
height: i32
) -> (i32, i32)
fn preferred_width_for_height<P: IsA<Widget>>( &self, widget: &P, height: i32 ) -> (i32, i32)
Retrieves a cell renderers’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
sourcefn preferred_width<P: IsA<Widget>>(&self, widget: &P) -> (i32, i32)
fn preferred_width<P: IsA<Widget>>(&self, widget: &P) -> (i32, i32)
Retrieves a renderer’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
sourcefn request_mode(&self) -> SizeRequestMode
fn request_mode(&self) -> SizeRequestMode
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.
sourcefn snapshot<P: IsA<Widget>>(
&self,
snapshot: &Snapshot,
widget: &P,
background_area: &Rectangle,
cell_area: &Rectangle,
flags: CellRendererState
)
fn snapshot<P: IsA<Widget>>( &self, snapshot: &Snapshot, widget: &P, background_area: &Rectangle, cell_area: &Rectangle, flags: CellRendererState )
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
sourcefn start_editing<P: IsA<Widget>>(
&self,
event: Option<&Event>,
widget: &P,
path: &str,
background_area: &Rectangle,
cell_area: &Rectangle,
flags: CellRendererState
) -> Option<CellEditable>
fn start_editing<P: IsA<Widget>>( &self, event: Option<&Event>, widget: &P, path: &str, background_area: &Rectangle, cell_area: &Rectangle, flags: CellRendererState ) -> Option<CellEditable>
Starts editing the contents of this @self, through a new CellEditable
widget created by the CellRenderer
Class.start_editing virtual function.
Deprecated since 4.10
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