Class: Gtk::CellArea
- Inherits:
-
GObject::InitiallyUnowned
- Object
- GObject::InitiallyUnowned
- Gtk::CellArea
- Defined in:
- (unknown)
Direct Known Subclasses
Instance Method Summary collapse
-
#activate(context, widget, cell_area, flags, edit_only) ⇒ Boolean
Activates area, usually by activating the currently focused cell, however some subclasses which embed widgets in the area can also activate a widget if it currently has the focus.
-
#activate_cell(widget, renderer, event, cell_area, flags) ⇒ Boolean
This is used by
GtkCellAreasubclasses when handling events to activate cells, the baseGtkCellAreaclass activates cells for keyboard events for free in its own GtkCellArea->activate() implementation. -
#add(renderer) ⇒ nil
Adds renderer to area with the default child cell properties.
-
#add_focus_sibling(renderer, sibling) ⇒ nil
Adds sibling to renderer’s focusable area, focus will be drawn around renderer and all of its siblings if renderer can focus for a given row.
-
#add_with_properties(renderer, first_prop_name, array) ⇒ nil
Adds renderer to area, setting cell properties at the same time.
-
#apply_attributes(tree_model, iter, is_expander, is_expanded) ⇒ nil
Applies any connected attributes to the renderers in area by pulling the values from tree_model.
-
#attribute_connect(renderer, attribute, column) ⇒ nil
Connects an attribute to apply values from column for the
GtkTreeModelin use. -
#attribute_disconnect(renderer, attribute) ⇒ nil
Disconnects attribute for the renderer in area so that attribute will no longer be updated with values from the model.
-
#attribute_get_column(renderer, attribute) ⇒ Integer
Returns the model column that an attribute has been mapped to, or -1 if the attribute is not mapped.
-
#cell_get(renderer, first_prop_name, array) ⇒ nil
Gets the values of one or more cell properties for renderer in area.
-
#cell_get_property(renderer, property_name, value) ⇒ nil
Gets the value of a cell property for renderer in area.
-
#cell_get_valist(renderer, first_property_name, var_args) ⇒ nil
Gets the values of one or more cell properties for renderer in area.
-
#cell_set(renderer, first_prop_name, array) ⇒ nil
Sets one or more cell properties for cell in area.
-
#cell_set_property(renderer, property_name, value) ⇒ nil
Sets a cell property for renderer in area.
-
#cell_set_valist(renderer, first_property_name, var_args) ⇒ nil
Sets one or more cell properties for renderer in area.
-
#copy_context(context) ⇒ Gtk::CellAreaContext
This is sometimes needed for cases where rows need to share alignments in one orientation but may be separately grouped in the opposing orientation.
-
#create_context ⇒ Gtk::CellAreaContext
Creates a
GtkCellAreaContext to be used with area for all purposes. -
#current_path_string ⇒ String
Gets the current
GtkTreePathstring for the currently appliedGtkTreeIter, this is implicitly updated when gtk_cell_area_apply_attributes() is called and can be used to interact with renderers fromGtkCellAreasubclasses. -
#edit_widget ⇒ Gtk::CellEditable
The widget currently editing the edited cell.
-
#edit_widget=(edit_widget) ⇒ Gtk::CellEditable
The widget currently editing the edited cell.
-
#edited_cell ⇒ Gtk::CellRenderer
The cell in the area that is currently edited.
-
#edited_cell=(edited_cell) ⇒ Gtk::CellRenderer
The cell in the area that is currently edited.
-
#event(context, widget, event, cell_area, flags) ⇒ Integer
Delegates event handling to a
GtkCellArea. -
#find_cell_property(property_name) ⇒ GObject::ParamSpec
Finds a cell property of a cell area class by name.
-
#focus(direction) ⇒ Boolean
This should be called by the area’s owning layout widget when focus is to be passed to area, or moved within area for a given direction and row data.
-
#focus_cell ⇒ Gtk::CellRenderer
The cell in the area that currently has focus.
-
#focus_cell=(focus_cell) ⇒ Gtk::CellRenderer
The cell in the area that currently has focus.
-
#foreach(callback, callback_data) ⇒ nil
Calls callback for every
GtkCellRendererin area. -
#foreach_alloc(context, widget, cell_area, background_area, callback, callback_data) ⇒ nil
Calls callback for every
GtkCellRendererin area with the allocated rectangle inside cell_area. -
#get_cell_allocation(context, widget, renderer, cell_area, allocation) ⇒ nil
Derives the allocation of renderer inside area if area were to be rendered in cell_area.
-
#get_cell_at_position(context, widget, cell_area, x, y, alloc_area) ⇒ Gtk::CellRenderer
Gets the
GtkCellRendererat x and y coordinates inside area and optionally returns the full cell allocation for it inside cell_area. -
#get_focus_from_sibling(renderer) ⇒ Gtk::CellRenderer
Gets the
GtkCellRendererwhich is expected to be focusable for which renderer is, or may be a sibling. -
#get_focus_siblings(renderer) ⇒ GLib::List<Gtk::CellRenderer>
Gets the focus sibling cell renderers for renderer.
-
#get_preferred_height(context, widget, minimum_height, natural_height) ⇒ nil
Retrieves a cell area’s initial minimum and natural height.
-
#get_preferred_height_for_width(context, widget, width, minimum_height, natural_height) ⇒ nil
Retrieves a cell area’s minimum and natural height if it would be given the specified width.
-
#get_preferred_width(context, widget, minimum_width, natural_width) ⇒ nil
Retrieves a cell area’s initial minimum and natural width.
-
#get_preferred_width_for_height(context, widget, height, minimum_width, natural_width) ⇒ nil
Retrieves a cell area’s minimum and natural width if it would be given the specified height.
-
#has_renderer(renderer) ⇒ Boolean
Checks if area contains renderer.
-
#inner_cell_area(widget, cell_area, inner_area) ⇒ nil
This is a convenience function for
GtkCellAreaimplementations to get the inner area where a givenGtkCellRendererwill be rendered. -
#install_cell_property(property_id, pspec) ⇒ nil
Installs a cell property on a cell area class.
-
#is_activatable ⇒ Boolean
Returns whether the area can do anything when activated, after applying new attributes to area.
-
#is_focus_sibling(renderer, sibling) ⇒ Boolean
Returns whether sibling is one of renderer’s focus siblings (see gtk_cell_area_add_focus_sibling()).
-
#list_cell_properties(n_properties) ⇒ Array<GObject::ParamSpec>
Returns all cell properties of a cell area class.
-
#remove(renderer) ⇒ nil
Removes renderer from area.
-
#remove_focus_sibling(renderer, sibling) ⇒ nil
Removes sibling from renderer’s focus sibling list (see gtk_cell_area_add_focus_sibling()).
-
#request_mode ⇒ Gtk::SizeRequestMode
Gets whether the area prefers a height-for-width layout or a width-for-height layout.
-
#request_renderer(renderer, orientation, widget, for_size, minimum_size, natural_size) ⇒ nil
This is a convenience function for
GtkCellAreaimplementations to request size for cell renderers. -
#snapshot(context, widget, snapshot, background_area, cell_area, flags, paint_focus) ⇒ nil
Snapshots area’s cells according to area’s layout onto at the given coordinates.
-
#stop_editing(canceled) ⇒ nil
Explicitly stops the editing of the currently edited cell.
Instance Method Details
#activate(context, widget, cell_area, flags, edit_only) ⇒ Boolean
Activates area, usually by activating the currently focused cell, however some subclasses which embed widgets in the area can also activate a widget if it currently has the focus.
#activate_cell(widget, renderer, event, cell_area, flags) ⇒ Boolean
This is used by GtkCellArea subclasses when handling events
to activate cells, the base GtkCellArea class activates cells
for keyboard events for free in its own GtkCellArea->activate()
implementation.
#add(renderer) ⇒ nil
Adds renderer to area with the default child cell properties.
#add_focus_sibling(renderer, sibling) ⇒ nil
Adds sibling to renderer’s focusable area, focus will be drawn around renderer and all of its siblings if renderer can focus for a given row.
Events handled by focus siblings can also activate the given focusable renderer.
#add_with_properties(renderer, first_prop_name, array) ⇒ nil
Adds renderer to area, setting cell properties at the same time. See gtk_cell_area_add() and gtk_cell_area_cell_set() for more details.
#apply_attributes(tree_model, iter, is_expander, is_expanded) ⇒ nil
Applies any connected attributes to the renderers in area by pulling the values from tree_model.
#attribute_connect(renderer, attribute, column) ⇒ nil
Connects an attribute to apply values from column for the
GtkTreeModel in use.
#attribute_disconnect(renderer, attribute) ⇒ nil
Disconnects attribute for the renderer in area so that attribute will no longer be updated with values from the model.
#attribute_get_column(renderer, attribute) ⇒ Integer
Returns the model column that an attribute has been mapped to, or -1 if the attribute is not mapped.
#cell_get(renderer, first_prop_name, array) ⇒ nil
Gets the values of one or more cell properties for renderer in area.
#cell_get_property(renderer, property_name, value) ⇒ nil
Gets the value of a cell property for renderer in area.
#cell_get_valist(renderer, first_property_name, var_args) ⇒ nil
Gets the values of one or more cell properties for renderer in area.
#cell_set(renderer, first_prop_name, array) ⇒ nil
Sets one or more cell properties for cell in area.
#cell_set_property(renderer, property_name, value) ⇒ nil
Sets a cell property for renderer in area.
#cell_set_valist(renderer, first_property_name, var_args) ⇒ nil
Sets one or more cell properties for renderer in area.
#copy_context(context) ⇒ Gtk::CellAreaContext
This is sometimes needed for cases where rows need to share alignments in one orientation but may be separately grouped in the opposing orientation.
For instance, GtkIconView creates all icons (rows) to have
the same width and the cells theirin to have the same
horizontal alignments. However each row of icons may have
a separate collective height. GtkIconView uses this to
request the heights of each row based on a context which
was already used to request all the row widths that are
to be displayed.
#create_context ⇒ Gtk::CellAreaContext
Creates a GtkCellAreaContext to be used with area for
all purposes. GtkCellAreaContext stores geometry information
for rows for which it was operated on, it is important to use
the same context for the same row of data at all times (i.e.
one should render and handle events with the same GtkCellAreaContext
which was used to request the size of those rows of data).
#current_path_string ⇒ String
Gets the current GtkTreePath string for the currently
applied GtkTreeIter, this is implicitly updated when
gtk_cell_area_apply_attributes() is called and can be
used to interact with renderers from GtkCellArea
subclasses.
attributes applied to area. This string belongs to the area and
should not be freed.
#edit_widget ⇒ Gtk::CellEditable
The widget currently editing the edited cell
This property is read-only and only changes as a result of a call gtk_cell_area_activate_cell().
#edit_widget=(edit_widget) ⇒ Gtk::CellEditable
The widget currently editing the edited cell
This property is read-only and only changes as a result of a call gtk_cell_area_activate_cell().
#edited_cell ⇒ Gtk::CellRenderer
The cell in the area that is currently edited
This property is read-only and only changes as a result of a call gtk_cell_area_activate_cell().
#edited_cell=(edited_cell) ⇒ Gtk::CellRenderer
The cell in the area that is currently edited
This property is read-only and only changes as a result of a call gtk_cell_area_activate_cell().
#event(context, widget, event, cell_area, flags) ⇒ Integer
Delegates event handling to a GtkCellArea.
#find_cell_property(property_name) ⇒ GObject::ParamSpec
Finds a cell property of a cell area class by name.
#focus(direction) ⇒ Boolean
This should be called by the area’s owning layout widget when focus is to be passed to area, or moved within area for a given direction and row data.
Implementing GtkCellArea classes should implement this
method to receive and navigate focus in its own way particular
to how it lays out cells.
#focus_cell ⇒ Gtk::CellRenderer
The cell in the area that currently has focus
#focus_cell=(focus_cell) ⇒ Gtk::CellRenderer
The cell in the area that currently has focus
#foreach(callback, callback_data) ⇒ nil
Calls callback for every GtkCellRenderer in area.
#foreach_alloc(context, widget, cell_area, background_area, callback, callback_data) ⇒ nil
Calls callback for every GtkCellRenderer in area with the
allocated rectangle inside cell_area.
#get_cell_allocation(context, widget, renderer, cell_area, allocation) ⇒ nil
Derives the allocation of renderer inside area if area were to be rendered in cell_area.
#get_cell_at_position(context, widget, cell_area, x, y, alloc_area) ⇒ Gtk::CellRenderer
Gets the GtkCellRenderer at x and y coordinates inside area and optionally
returns the full cell allocation for it inside cell_area.
#get_focus_from_sibling(renderer) ⇒ Gtk::CellRenderer
Gets the GtkCellRenderer which is expected to be focusable
for which renderer is, or may be a sibling.
This is handy for GtkCellArea subclasses when handling events,
after determining the renderer at the event location it can
then chose to activate the focus cell for which the event
cell may have been a sibling.
#get_focus_siblings(renderer) ⇒ GLib::List<Gtk::CellRenderer>
Gets the focus sibling cell renderers for renderer.
#get_preferred_height(context, widget, minimum_height, natural_height) ⇒ nil
Retrieves a cell area’s initial minimum and natural height.
area will store some geometrical information in context along the way; when requesting sizes over an arbitrary number of rows, it’s not important to check the minimum_height and natural_height of this call but rather to consult gtk_cell_area_context_get_preferred_height() after a series of requests.
#get_preferred_height_for_width(context, widget, width, minimum_height, natural_height) ⇒ nil
Retrieves a cell area’s minimum and natural height if it would be given the specified width.
area stores some geometrical information in context along the way while calling gtk_cell_area_get_preferred_width(). It’s important to perform a series of gtk_cell_area_get_preferred_width() requests with context first and then call gtk_cell_area_get_preferred_height_for_width() on each cell area individually to get the height for width of each fully requested row.
If at some point, the width of a single row changes, it should be requested with gtk_cell_area_get_preferred_width() again and then the full width of the requested rows checked again with gtk_cell_area_context_get_preferred_width().
#get_preferred_width(context, widget, minimum_width, natural_width) ⇒ nil
Retrieves a cell area’s initial minimum and natural width.
area will store some geometrical information in context along the way; when requesting sizes over an arbitrary number of rows, it’s not important to check the minimum_width and natural_width of this call but rather to consult gtk_cell_area_context_get_preferred_width() after a series of requests.
#get_preferred_width_for_height(context, widget, height, minimum_width, natural_width) ⇒ nil
Retrieves a cell area’s minimum and natural width if it would be given the specified height.
area stores some geometrical information in context along the way while calling gtk_cell_area_get_preferred_height(). It’s important to perform a series of gtk_cell_area_get_preferred_height() requests with context first and then call gtk_cell_area_get_preferred_width_for_height() on each cell area individually to get the height for width of each fully requested row.
If at some point, the height of a single row changes, it should be requested with gtk_cell_area_get_preferred_height() again and then the full height of the requested rows checked again with gtk_cell_area_context_get_preferred_height().
#has_renderer(renderer) ⇒ Boolean
Checks if area contains renderer.
#inner_cell_area(widget, cell_area, inner_area) ⇒ nil
This is a convenience function for GtkCellArea implementations
to get the inner area where a given GtkCellRenderer will be
rendered. It removes any padding previously added by gtk_cell_area_request_renderer().
#install_cell_property(property_id, pspec) ⇒ nil
Installs a cell property on a cell area class.
#is_activatable ⇒ Boolean
Returns whether the area can do anything when activated, after applying new attributes to area.
#is_focus_sibling(renderer, sibling) ⇒ Boolean
Returns whether sibling is one of renderer’s focus siblings (see gtk_cell_area_add_focus_sibling()).
#list_cell_properties(n_properties) ⇒ Array<GObject::ParamSpec>
Returns all cell properties of a cell area class.
#remove(renderer) ⇒ nil
Removes renderer from area.
#remove_focus_sibling(renderer, sibling) ⇒ nil
Removes sibling from renderer’s focus sibling list (see gtk_cell_area_add_focus_sibling()).
#request_mode ⇒ Gtk::SizeRequestMode
Gets whether the area prefers a height-for-width layout or a width-for-height layout.
#request_renderer(renderer, orientation, widget, for_size, minimum_size, natural_size) ⇒ nil
This is a convenience function for GtkCellArea implementations
to request size for cell renderers. It’s important to use this
function to request size and then use gtk_cell_area_inner_cell_area()
at render and event time since this function will add padding
around the cell for focus painting.
the base request for the orientation is to be returned.
#snapshot(context, widget, snapshot, background_area, cell_area, flags, paint_focus) ⇒ nil
Snapshots area’s cells according to area’s layout onto at the given coordinates.
#stop_editing(canceled) ⇒ nil
Explicitly stops the editing of the currently edited cell.
If canceled is true, the currently edited cell renderer will emit the ::editing-canceled signal, otherwise the the ::editing-done signal will be emitted on the current edit widget.
See gtk_cell_area_get_edited_cell() and gtk_cell_area_get_edit_widget().