W Wrapl, The Programming Language

Libraries:Gtk:Gtk:CellRenderer

Types

T

Inherits from:

The T is a base class of a set of objects used for rendering a cell to a Gtk.Gdk.Drawable.T. These objects are used primarily by the Gtk.Gtk.TreeView.T widget, though they aren't tied to them in any specific way. It is worth noting that T is not a Gtk.Gtk.Widget.T and cannot be treated as such.

The primary use of a T is for drawing a certain graphical elements on a Gtk.Gdk.Drawable.T. Typically, one cell renderer is used to draw many cells on the screen. To this extent, it isn't expected that a CellRenderer keep any permanent state around. Instead, any state is set just prior to use using GObjects property system. Then, the cell is measured using GetSize. Finally, the cell is rendered in the correct location using Render.

There are a number of rules that must be followed when writing a new T. First and formost, it's important that a certain set of properties will always yield a cell renderer of the same size, barring a Gtk.Gtk.Style.T change. The T also has a number of generic properties that are expected to be honored by all children.

Beyond merely rendering a cell, cell renderers can optionally provide active user interface elements. A cell renderer can be activatable like Gtk.Gtk.CellRendererToggle.T, which toggles when it gets activated by a mouse click, or it can be editable like Gtk.Gtk.CellRendererText.T, which allows the user to edit the text using a Gtk.Gtk.Entry.T. To make a cell renderer activatable or editable, you have to implement the activate or start_editing virtual functions, respectively.



Constants

Nil : T

Functions

GetType() : Gtk.GObject.Type.T



Methods

:Activate(self @ T, event @ Gtk.Gdk.Event.T, widget @ Gtk.Gtk.Widget.T, path @ Std.String.T, background_area @ Gtk.Gdk.Rectangle.T, cell_area @ Gtk.Gdk.Rectangle.T, flags @ Std.Integer.SmallT) : Std.Symbol.T

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

cell a T
event a GdkEvent
widget widget that received the event
path widget-dependent string representation of the event location; e.g. for Gtk.Gtk.TreeView.T, a string representation of Gtk.Gtk.TreePath.T
background_area background area as passed to Render
cell_area cell area as passed to Render
flags render flags
Returns TRUE if the event was consumed/handled


:EditingCanceled(self @ T) : Std.Object.T

Warning

EditingCanceled has been deprecated since version 2.6 and should not be used in newly-written code. Use StopEditing instead



:GetAlignment(self @ T, xalign @ Std.Object.T, yalign @ Std.Object.T) : Std.Object.T

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

cell A T
xalign location to fill in with the x alignment of the cell, or NULL. [out][allow-none]
yalign location to fill in with the y alignment of the cell, or NULL. [out][allow-none]


:GetFixedSize(self @ T, width @ Std.Object.T, height @ Std.Object.T) : Std.Object.T

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

cell A T
width location to fill in with the fixed width of the cell, or NULL. [out][allow-none]
height location to fill in with the fixed height of the cell, or NULL. [out][allow-none]


:GetPadding(self @ T, xpad @ Std.Object.T, ypad @ Std.Object.T) : Std.Object.T

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

cell A T
xpad location to fill in with the x padding of the cell, or NULL. [out][allow-none]
ypad location to fill in with the y padding of the cell, or NULL. [out][allow-none]


:GetSensitive(self @ T) : Std.Symbol.T

Returns the cell renderer's sensitivity.

cell A T
Returns TRUE if the cell renderer is sensitive


:GetSize(self @ T, widget @ Gtk.Gtk.Widget.T, cell_area @ Gtk.Gdk.Rectangle.T, x_offset @ Std.Object.T, y_offset @ Std.Object.T, width @ Std.Object.T, height @ Std.Object.T) : Std.Object.T

Obtains the width and height needed to render the cell. Used by view widgets to determine the appropriate size for the cell_area passed to Render. If cell_area is not NULL, fills in the x and y offsets (if set) of the cell relative to this location.

Please note that the values set in width and height, as well as those in x_offset and y_offset are inclusive of the xpad and ypad properties.

cell a T
widget the widget the renderer is rendering to
cell_area The area a cell will be allocated, or NULL. [allow-none]
x_offset location to return x offset of cell relative to cell_area, or NULL. [out][allow-none]
y_offset location to return y offset of cell relative to cell_area, or NULL. [out][allow-none]
width location to return width needed to render a cell, or NULL. [out][allow-none]
height location to return height needed to render a cell, or NULL. [out][allow-none]


:GetVisible(self @ T) : Std.Symbol.T

Returns the cell renderer's visibility.

cell A T
Returns TRUE if the cell renderer is visible


:Render(self @ T, window @ Gtk.Gdk.Window.T, widget @ Gtk.Gtk.Widget.T, background_area @ Gtk.Gdk.Rectangle.T, cell_area @ Gtk.Gdk.Rectangle.T, expose_area @ Gtk.Gdk.Rectangle.T, flags @ Std.Integer.SmallT) : Std.Object.T

Invokes the virtual render function of the T. The three passed-in rectangles are areas of window. Most renderers will draw within cell_area; the xalign, yalign, xpad, and ypad fields of the T 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. expose_area is a clip rectangle.

cell a T
window a Gtk.Gdk.Drawable.T 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
expose_area area that actually needs updating
flags flags that affect rendering


:SetAlignment(self @ T, xalign @ Std.Real.T, yalign @ Std.Real.T) : Std.Object.T

Sets the renderer's alignment within its available space.

cell A T
xalign the x alignment of the cell renderer
yalign the y alignment of the cell renderer


:SetFixedSize(self @ T, width @ Std.Integer.SmallT, height @ Std.Integer.SmallT) : Std.Object.T

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

cell A T
width the width of the cell renderer, or -1
height the height of the cell renderer, or -1


:SetPadding(self @ T, xpad @ Std.Integer.SmallT, ypad @ Std.Integer.SmallT) : Std.Object.T

Sets the renderer's padding.

cell A T
xpad the x padding of the cell renderer
ypad the y padding of the cell renderer


:SetSensitive(self @ T, sensitive @ Std.Symbol.T) : Std.Object.T

Sets the cell renderer's sensitivity.

cell A T
sensitive the sensitivity of the cell


:SetVisible(self @ T, visible @ Std.Symbol.T) : Std.Object.T

Sets the cell renderer's visibility.

cell A T
visible the visibility of the cell


:StartEditing(self @ T, event @ Gtk.Gdk.Event.T, widget @ Gtk.Gtk.Widget.T, path @ Std.String.T, background_area @ Gtk.Gdk.Rectangle.T, cell_area @ Gtk.Gdk.Rectangle.T, flags @ Std.Integer.SmallT) : Gtk.Gtk.CellEditable.T

Passes an activate event to the cell renderer for possible processing.

cell a T
event a GdkEvent
widget widget that received the event
path widget-dependent string representation of the event location; e.g. for Gtk.Gtk.TreeView.T, a string representation of Gtk.Gtk.TreePath.T
background_area background area as passed to Render
cell_area cell area as passed to Render
flags render flags
Returns A new Gtk.Gtk.CellEditable.T, or NULL. [transfer none]


:StopEditing(self @ T, canceled @ Std.Symbol.T) : Std.Object.T

Informs the cell renderer that the editing is stopped. If canceled is TRUE, the cell renderer will emit the "editing-canceled" signal.

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

cell A T
canceled TRUE if the editing has been canceled