GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  GTK2::CELLRENDERER (3)

.ds Aq ’

NAME

Gtk2::CellRenderer - An object that renders a single cell onto a Gtk2::Gdk::Drawable

CONTENTS

DESCRIPTION

The Gtk2::CellRenderer is the base class for objects which render cells onto drawables. These objects are used primarily by the Gtk2::TreeView, though they aren’t tied to them in any specific way.

Typically, one cell renderer is used to draw many cells onto the screen. Thus, the cell renderer doesn’t keep state; instead, any state is set immediately prior to use through the object property system. The cell is measured with get_size, and then renderered with render.

HIERARCHY



  Glib::Object
  +----Glib::InitiallyUnowned
       +----Gtk2::Object
            +----Gtk2::CellRenderer



METHODS

boolean = CW$cell->activate ($event, CW$widget, CW$path, CW$background_area, CW$cell_area, CW$flags)

o $event (Gtk2::Gdk::Event)
o $widget (Gtk2::Widget)
o $path (string)
o $background_area (Gtk2::Gdk::Rectangle)
o $cell_area (Gtk2::Gdk::Rectangle)
o $flags (Gtk2::CellRendererState)

(xalign, yalign) = CW$cell->get_alignment

Since: gtk+ 2.18

CW$cell->set_alignment ($xalign, CW$yalign)

o $xalign (double)
o $yalign (double)
Since: gtk+ 2.18

CW$cell->editing_canceled

Since: gtk+ 2.4

(width, height) = CW$cell->get_fixed_size

Fetch the fixed size if $cell. Values of -1 mean this dimension is not fixed.

CW$cell->set_fixed_size ($width, CW$height)

o $width (integer)
o $height (integer)
Set the renderer’s size explicitly, independent of object properties. A value of -1 means don’t use a fixed size for this dimension.

(xpad, ypad) = CW$cell->get_padding

Since: gtk+ 2.18

CW$cell->set_padding ($xpad, CW$ypad)

o $xpad (integer)
o $ypad (integer)
Since: gtk+ 2.18

CW$cell->render ($drawable, CW$widget, CW$background_area, CW$cell_area, CW$expose_area, CW$flags)

o $drawable (Gtk2::Gdk::Drawable)
o $widget (Gtk2::Widget)
o $background_area (Gtk2::Gdk::Rectangle)
o $cell_area (Gtk2::Gdk::Rectangle)
o $expose_area (Gtk2::Gdk::Rectangle)
o $flags (Gtk2::CellRendererState)

boolean = CW$cell->get_sensitive

Since: gtk+ 2.18

CW$cell->set_sensitive ($sensitive)

o $sensitive (boolean)
Since: gtk+ 2.18

(x_offset, y_offset, width, height) = CW$cell->get_size ($widget, CW$cell_area)

o $widget (Gtk2::Widget)
o $cell_area (Gtk2::Gdk::Rectangle or undef)

celleditable or undef = CW$cell->start_editing ($event, CW$widget, CW$path, CW$background_area, CW$cell_area, CW$flags)

o $event (Gtk2::Gdk::Event)
o $widget (Gtk2::Widget)
o $path (string)
o $background_area (Gtk2::Gdk::Rectangle)
o $cell_area (Gtk2::Gdk::Rectangle)
o $flags (Gtk2::CellRendererState)

CW$cell->stop_editing ($canceled)

o $canceled (boolean)
Since: gtk+ 2.6

boolean = CW$cell->get_visible

Since: gtk+ 2.18

CW$cell->set_visible ($visible)

o $visible (boolean)
Since: gtk+ 2.18

PROPERTIES

’cell-background’ (string : default undef : writable / private) Cell background color as a string
’cell-background-gdk’ (Gtk2::Gdk::Color : default undef : readable / writable / private) Cell background color as a GdkColor
’cell-background-set’ (boolean : default false : readable / writable / private) Whether this tag affects the cell background color
’editing’ (boolean : default false : readable / private) Whether the cell renderer is currently in editing mode
’height’ (integer : default -1 : readable / writable / private) The fixed height
’is-expanded’ (boolean : default false : readable / writable / private) Row is an expander row, and is expanded
’is-expander’ (boolean : default false : readable / writable / private) Row has children
’mode’ (Gtk2::CellRendererMode : default ‘‘inert’’ : readable / writable / private) Editable mode of the CellRenderer
’sensitive’ (boolean : default true : readable / writable / private) Display the cell sensitive
’visible’ (boolean : default true : readable / writable / private) Display the cell
’width’ (integer : default -1 : readable / writable / private) The fixed width
’xalign’ (float : default 0.5 : readable / writable / private) The x-align
’xpad’ (Glib::UInt : default 0 : readable / writable / private) The xpad
’yalign’ (float : default 0.5 : readable / writable / private) The y-align
’ypad’ (Glib::UInt : default 0 : readable / writable / private) The ypad

SIGNALS

<B>editing-canceledB> (Gtk2::CellRenderer)
<B>editing-startedB> (Gtk2::CellRenderer, Gtk2::CellEditable, string)

ENUMS AND FLAGS

    enum Gtk2::CellRendererMode

o ’inert’ / ’GTK_CELL_RENDERER_MODE_INERT
o ’activatable’ / ’GTK_CELL_RENDERER_MODE_ACTIVATABLE
o ’editable’ / ’GTK_CELL_RENDERER_MODE_EDITABLE

    flags Gtk2::CellRendererState

o ’selected’ / ’GTK_CELL_RENDERER_SELECTED
o ’prelit’ / ’GTK_CELL_RENDERER_PRELIT
o ’insensitive’ / ’GTK_CELL_RENDERER_INSENSITIVE
o ’sorted’ / ’GTK_CELL_RENDERER_SORTED
o ’focused’ / ’GTK_CELL_RENDERER_FOCUSED

DERIVING NEW CELL RENDERERS

Gtk+ provides three cell renderers: Gtk2::CellRendererText, Gtk2::CellRendererToggle, and Gtk2::CellRendererPixbuf. You may derive a new renderer from any of these, or directly from Gtk2::CellRenderer itself.

There are a number of rules that must be followed when writing a new cell renderer. First and foremost, it’s important that a certain set of properties always yields a cell of the same size, barring a Gtk2::Style change. The cell renderer also has a number of generic properties that are expected to be honored by all children.

The new renderer must be a GObject, so you must follow the normal procedure for creating a new Glib::Object (i.e., either Glib::Object::Subclass or Glib::Type::register_object). The new subclass can customize the object’s behavior by providing new implementations of these four methods:
(x_offset, y_offset, width, height) = GET_SIZE ($cell, $widget, $cell_area)
o $cell (Gtk2::CellRenderer)
o $widget (Gtk2::Widget) widget to which $cell is rendering
o $cell_area (Gtk2::Gdk::Rectangle or undef) The area a cell will be allocated, or undef.

Return Values:
- x_offset - x offset of cell relative to $cell_area
- y_offset - y offset of cell relative to $cell_area
- width - width needed to render cell
- height - height needed to render cell

This is called to calculate the size of the cell for display, taking into account the padding and alignment properties of the parent. This one will be called very often. If you need to know your cell’s data, then get it from the appropriate object properties, which will be set accordingly before this method is called.

RENDER ($cell, $drawable, $widget, $background_area, $cell_area, $expose_area, $flags)
o $cell (Gtk2::CellRenderer)
o $drawable (Gtk2::Gdk::Drawable) window on which to draw
o $widget (Gtk2::Widget) widget owning $drawable
o $background_area (Gtk2::Gdk::Rectangle) entire cell area (including tree expanders and maybe padding on the sides)
o $cell_area (Gtk2::Gdk::Rectangle) area normally rendered by a cell renderer
o $expose_area (Gtk2::Gdk::Rectangle) area that actually needs updating
o $flags (Gtk2::CellRendererState) flags that affect rendering

This is called to render the cell onto the screen. As with GET_SIZE, the data for the cell comes from object properties. In general, you’ll want to make use of Gtk2::Style methods for drawing anything fancy.

The three passed-in rectangles are areas of $drawable. Most renderers draw within $cell_area; the xalign, yalign, xpad, and ypad fields of the cell renderer 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 cover the entire $drawable. $expose_area is a clip rectangle.

boolean = ACTIVATE ($cell, $event, $widget, $path, $background_area, $cell_area, $flags)
o $cell (Gtk2::CellRenderer)
o $event (Gtk2::Gdk::Event)
o $widget (Gtk2::Widget) widget that received the event
o $path (string) widget-dependent string representation of the event location; e.g. for a Gtk2::TreeView, a string representation of a Gtk2::TreePath.
o $background_area (Gtk2::Gdk::Rectangle) background area as passed to RENDER.
o $cell_area (Gtk2::Gdk::Rectangle) cell area as passed to RENDER.
o $flags (Gtk2::CellRendererState) render flags

This method is called when an event occurs on a cell. Implementing it is not mandatory. The return value should be TRUE if the event was consumed/handled.

celleditable or undef = START_EDITING ($cell, $event, $widget, $path, $background_area, $cell_area, $flags)
o $cell (Gtk2::CellRenderer)
o $event (Gtk2::Gdk::Event)
o $widget (Gtk2::Widget) widget that received the event
o $path (string) widget-dependent string representation of the event location; e.g. for a Gtk2::TreeView, a string representation of a Gtk2::TreePath.
o $background_area (Gtk2::Gdk::Rectangle) background area as passed to RENDER.
o $cell_area (Gtk2::Gdk::Rectangle) cell area as passed to RENDER.
o $flags (Gtk2::CellRendererState) render flags

For cells that are editable, this is called to put the cell into editing mode. If the return value is an object is a Gtk2::CellEditable, that widget will be used to edit the value; the calling code takes care of sizing, placing, and showing the editable, you just need to return it. If the return value is undef, the editing is aborted.

Note: for backward compatibility, the bizarre and non-standard scheme used for this in 1.02x is still supported, but is deprecated and should not be used in new code, and since i don’t want people to use it any more i will not document it here.

SEE ALSO

Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object

COPYRIGHT

Copyright (C) 2003-2011 by the gtk2-perl team.

This software is licensed under the LGPL. See Gtk2 for a full notice.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 GTK2::CELLRENDERER (3) 2016-04-05

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.