Class: Gtk::CellRenderer

Inherits:
GObject::InitiallyUnowned
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#activate(event, widget, path, background_area, cell_area, flags) ⇒ Boolean

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

Parameters:

  • event (Gdk::Event)

    a GdkEvent

  • widget (Gtk::Widget)

    widget that received the event

  • path (String)

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

  • background_area (Gdk::Rectangle)

    background area as passed to gtk_cell_renderer_render()

  • cell_area (Gdk::Rectangle)

    cell area as passed to gtk_cell_renderer_render()

  • flags (Gtk::CellRendererState)

    render flags

Returns:

  • (Boolean)

    true if the event was consumed/handled

#cell_background=(cell_background) ⇒ String

Returns cell-background.

Parameters:

  • cell_background (String)

Returns:

  • (String)

    cell-background

#cell_background_rgbaGdk::RGBA

Cell background as a GdkRGBA

Returns:

  • (Gdk::RGBA)

    cell-background-rgba

#cell_background_rgba=(cell_background_rgba) ⇒ Gdk::RGBA

Cell background as a GdkRGBA

Parameters:

  • cell_background_rgba (Gdk::RGBA)

Returns:

  • (Gdk::RGBA)

    cell-background-rgba

  • (Gdk::RGBA)

    cell-background-rgba

#cell_background_set=(cell_background_set) ⇒ Boolean

Parameters:

  • cell_background_set (Boolean)

Returns:

  • (Boolean)

    cell-background-set

  • (Boolean)

    cell-background-set

#cell_background_set?Boolean

Returns cell-background-set.

Returns:

  • (Boolean)

    cell-background-set

#editing=(editing) ⇒ Boolean

Parameters:

  • editing (Boolean)

Returns:

  • (Boolean)

    editing

  • (Boolean)

    editing

#editing?Boolean

Returns editing.

Returns:

  • (Boolean)

    editing

#get_aligned_area(widget, flags, cell_area, aligned_area) ⇒ nil

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

Parameters:

  • widget (Gtk::Widget)

    the GtkWidget this cell will be rendering to

  • flags (Gtk::CellRendererState)

    render flags

  • cell_area (Gdk::Rectangle)

    cell area which would be passed to gtk_cell_renderer_render()

  • aligned_area (Gdk::Rectangle)

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

Returns:

  • (nil)

#get_alignment(xalign, yalign) ⇒ nil

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

Parameters:

  • xalign (Gtk::gfloat)

    location to fill in with the x alignment of the cell

  • yalign (Gtk::gfloat)

    location to fill in with the y alignment of the cell

Returns:

  • (nil)

#get_fixed_size(width, height) ⇒ nil

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

Parameters:

  • width (Integer)

    location to fill in with the fixed width of the cell

  • height (Integer)

    location to fill in with the fixed height of the cell

Returns:

  • (nil)

#get_padding(xpad, ypad) ⇒ nil

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

Parameters:

  • xpad (Integer)

    location to fill in with the x padding of the cell

  • ypad (Integer)

    location to fill in with the y padding of the cell

Returns:

  • (nil)

#get_preferred_height(widget, minimum_size, natural_size) ⇒ nil

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

Parameters:

  • widget (Gtk::Widget)

    the GtkWidget this cell will be rendering to

  • minimum_size (Integer)

    location to store the minimum size

  • natural_size (Integer)

    location to store the natural size

Returns:

  • (nil)

#get_preferred_height_for_width(widget, width, minimum_height, natural_height) ⇒ nil

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

Parameters:

  • widget (Gtk::Widget)

    the GtkWidget this cell will be rendering to

  • width (Integer)

    the size which is available for allocation

  • minimum_height (Integer)

    location for storing the minimum size

  • natural_height (Integer)

    location for storing the preferred size

Returns:

  • (nil)

#get_preferred_size(widget, minimum_size, natural_size) ⇒ nil

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

Parameters:

  • widget (Gtk::Widget)

    the GtkWidget this cell will be rendering to

  • minimum_size (Gtk::Requisition)

    location for storing the minimum size

  • natural_size (Gtk::Requisition)

    location for storing the natural size

Returns:

  • (nil)

#get_preferred_width(widget, minimum_size, natural_size) ⇒ nil

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

Parameters:

  • widget (Gtk::Widget)

    the GtkWidget this cell will be rendering to

  • minimum_size (Integer)

    location to store the minimum size

  • natural_size (Integer)

    location to store the natural size

Returns:

  • (nil)

#get_preferred_width_for_height(widget, height, minimum_width, natural_width) ⇒ nil

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

Parameters:

  • widget (Gtk::Widget)

    the GtkWidget this cell will be rendering to

  • height (Integer)

    the size which is available for allocation

  • minimum_width (Integer)

    location for storing the minimum size

  • natural_width (Integer)

    location for storing the preferred size

Returns:

  • (nil)

#get_state(widget, cell_state) ⇒ Gtk::StateFlags

Translates the cell renderer state to GtkStateFlags, based on the cell renderer and widget sensitivity, and the given GtkCellRendererState.

Parameters:

Returns:

#heightInteger

Returns height.

Returns:

  • (Integer)

    height

#height=(height) ⇒ Integer

Parameters:

  • height (Integer)

Returns:

  • (Integer)

    height

  • (Integer)

    height

#is_activatableBoolean

Checks whether the cell renderer can do something when activated.

Returns:

  • (Boolean)

    true if the cell renderer can do anything when activated

#is_expandedBoolean

Checks whether the given GtkCellRenderer is expanded.

Returns:

  • (Boolean)

    true if the cell renderer is expanded

#is_expanded=(is_expanded) ⇒ Boolean

Parameters:

  • is_expanded (Boolean)

Returns:

  • (Boolean)

    is-expanded

  • (Boolean)

    is-expanded

#is_expanded?Boolean

Returns is-expanded.

Returns:

  • (Boolean)

    is-expanded

#is_expanderBoolean

Checks whether the given GtkCellRenderer is an expander.

Returns:

  • (Boolean)

    true if cell is an expander, and false otherwise

#is_expander=(is_expander) ⇒ Boolean

Parameters:

  • is_expander (Boolean)

Returns:

  • (Boolean)

    is-expander

  • (Boolean)

    is-expander

#is_expander?Boolean

Returns is-expander.

Returns:

  • (Boolean)

    is-expander

#modeGtk::CellRendererMode

Returns mode.

Returns:

#mode=(mode) ⇒ Gtk::CellRendererMode

Parameters:

Returns:

#request_modeGtk::SizeRequestMode

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

Returns:

#sensitiveBoolean

Returns the cell renderer’s sensitivity.

Returns:

  • (Boolean)

    true if the cell renderer is sensitive

#sensitive=(sensitive) ⇒ Boolean

Parameters:

  • sensitive (Boolean)

Returns:

  • (Boolean)

    sensitive

  • (Boolean)

    sensitive

#sensitive?Boolean

Returns sensitive.

Returns:

  • (Boolean)

    sensitive

#set_alignment(xalign, yalign) ⇒ nil

Sets the renderer’s alignment within its available space.

Parameters:

  • xalign (Gtk::gfloat)

    the x alignment of the cell renderer

  • yalign (Gtk::gfloat)

    the y alignment of the cell renderer

Returns:

  • (nil)

#set_fixed_size(width, height) ⇒ nil

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

Parameters:

  • width (Integer)

    the width of the cell renderer, or -1

  • height (Integer)

    the height of the cell renderer, or -1

Returns:

  • (nil)

#set_padding(xpad, ypad) ⇒ nil

Sets the renderer’s padding.

Parameters:

  • xpad (Integer)

    the x padding of the cell renderer

  • ypad (Integer)

    the y padding of the cell renderer

Returns:

  • (nil)

#snapshot(snapshot, widget, background_area, cell_area, flags) ⇒ nil

Invokes the virtual render function of the GtkCellRenderer. 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 GtkCellRenderer 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.

Parameters:

  • snapshot (Gtk::Snapshot)

    a GtkSnapshot to draw to

  • widget (Gtk::Widget)

    the widget owning window

  • background_area (Gdk::Rectangle)

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

  • cell_area (Gdk::Rectangle)

    area normally rendered by a cell renderer

  • flags (Gtk::CellRendererState)

    flags that affect rendering

Returns:

  • (nil)

#start_editing(event, widget, path, background_area, cell_area, flags) ⇒ Gtk::CellEditable

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

Parameters:

  • event (Gdk::Event)

    a GdkEvent

  • widget (Gtk::Widget)

    widget that received the event

  • path (String)

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

  • background_area (Gdk::Rectangle)

    background area as passed to gtk_cell_renderer_render()

  • cell_area (Gdk::Rectangle)

    cell area as passed to gtk_cell_renderer_render()

  • flags (Gtk::CellRendererState)

    render flags

Returns:

  • (Gtk::CellEditable)

    A new GtkCellEditable for editing this cell, or nil if editing is not possible

#stop_editing(canceled) ⇒ nil

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

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

Parameters:

  • canceled (Boolean)

    true if the editing has been canceled

Returns:

  • (nil)

#visibleBoolean

Returns the cell renderer’s visibility.

Returns:

  • (Boolean)

    true if the cell renderer is visible

#visible=(visible) ⇒ Boolean

Parameters:

  • visible (Boolean)

Returns:

  • (Boolean)

    visible

  • (Boolean)

    visible

#visible?Boolean

Returns visible.

Returns:

  • (Boolean)

    visible

#widthInteger

Returns width.

Returns:

  • (Integer)

    width

#width=(width) ⇒ Integer

Parameters:

  • width (Integer)

Returns:

  • (Integer)

    width

  • (Integer)

    width

#xalignGtk::gfloat

Returns xalign.

Returns:

  • (Gtk::gfloat)

    xalign

#xalign=(xalign) ⇒ Gtk::gfloat

Parameters:

  • xalign (Gtk::gfloat)

Returns:

  • (Gtk::gfloat)

    xalign

  • (Gtk::gfloat)

    xalign

#xpadInteger

Returns xpad.

Returns:

  • (Integer)

    xpad

#xpad=(xpad) ⇒ Integer

Parameters:

  • xpad (Integer)

Returns:

  • (Integer)

    xpad

  • (Integer)

    xpad

#yalignGtk::gfloat

Returns yalign.

Returns:

  • (Gtk::gfloat)

    yalign

#yalign=(yalign) ⇒ Gtk::gfloat

Parameters:

  • yalign (Gtk::gfloat)

Returns:

  • (Gtk::gfloat)

    yalign

  • (Gtk::gfloat)

    yalign

#ypadInteger

Returns ypad.

Returns:

  • (Integer)

    ypad

#ypad=(ypad) ⇒ Integer

Parameters:

  • ypad (Integer)

Returns:

  • (Integer)

    ypad

  • (Integer)

    ypad