Package ch.bailu.gtk.gtk
Klasse CellRenderer
- Alle implementierten Schnittstellen:
PointerInterface
- Bekannte direkte Unterklassen:
CellRendererPixbuf,CellRendererProgress,CellRendererSpinner,CellRendererText,CellRendererToggle
An object for rendering a single cell
The `GtkCellRenderer` is a base class of a set of objects used for
rendering a cell to a `cairo_t`. These objects are used primarily by
the `GtkTreeView` widget, though they aren’t tied to them in any
specific way. It is worth noting that `GtkCellRenderer` is not a
`GtkWidget` and cannot be treated as such.
The primary use of a `GtkCellRenderer` is for drawing a certain graphical
elements on a `cairo_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 `GObject`s property system. Then, the
cell is measured using gtk_cell_renderer_get_preferred_size(). Finally, the cell
is rendered in the correct location using gtk_cell_renderer_snapshot().
There are a number of rules that must be followed when writing a new
`GtkCellRenderer`. First and foremost, it’s important that a certain set
of properties will always yield a cell renderer of the same size,
barring a style change. The `GtkCellRenderer` 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 `GtkCellRenderer`Toggle,
which toggles when it gets activated by a mouse click, or it can be
“editable” like `GtkCellRenderer`Text, which
allows the user to edit the text using a widget implementing the
`GtkCellEditable` interface, e.g. `GtkEntry`.
To make a cell renderer activatable or editable, you have to
implement the `GtkCellRenderer`Class.activate or
`GtkCellRenderer`Class.start_editing virtual functions, respectively.
Many properties of `GtkCellRenderer` and its subclasses have a
corresponding “set” property, e.g. “cell-background-set” corresponds
to “cell-background”. These “set” properties reflect whether a property
has been set or not. You should not set them independently.
The `GtkCellRenderer` is a base class of a set of objects used for
rendering a cell to a `cairo_t`. These objects are used primarily by
the `GtkTreeView` widget, though they aren’t tied to them in any
specific way. It is worth noting that `GtkCellRenderer` is not a
`GtkWidget` and cannot be treated as such.
The primary use of a `GtkCellRenderer` is for drawing a certain graphical
elements on a `cairo_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 `GObject`s property system. Then, the
cell is measured using gtk_cell_renderer_get_preferred_size(). Finally, the cell
is rendered in the correct location using gtk_cell_renderer_snapshot().
There are a number of rules that must be followed when writing a new
`GtkCellRenderer`. First and foremost, it’s important that a certain set
of properties will always yield a cell renderer of the same size,
barring a style change. The `GtkCellRenderer` 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 `GtkCellRenderer`Toggle,
which toggles when it gets activated by a mouse click, or it can be
“editable” like `GtkCellRenderer`Text, which
allows the user to edit the text using a widget implementing the
`GtkCellEditable` interface, e.g. `GtkEntry`.
To make a cell renderer activatable or editable, you have to
implement the `GtkCellRenderer`Class.activate or
`GtkCellRenderer`Class.start_editing virtual functions, respectively.
Many properties of `GtkCellRenderer` and its subclasses have a
corresponding “set” property, e.g. “cell-background-set” corresponds
to “cell-background”. These “set” properties reflect whether a property
has been set or not. You should not set them independently.
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic interfacestatic interfaceVon Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify -
Feldübersicht
FelderVon Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanactivate(Event event, Widget widget, Str path, Rectangle background_area, Rectangle cell_area, int flags) Veraltet.booleanactivate(Event event, Widget widget, String path, Rectangle background_area, Rectangle cell_area, int flags) Veraltet.voidgetAlignedArea(Widget widget, int flags, Rectangle cell_area, Rectangle aligned_area) Veraltet.voidgetAlignment(Flt xalign, Flt yalign) Veraltet.static ClassHandlervoidgetFixedSize(Int width, Int height) Veraltet.static intbooleanVeraltet.booleanVeraltet.voidgetPadding(Int xpad, Int ypad) Veraltet.static longstatic TypeSystem.TypeSizevoidgetPreferredHeight(Widget widget, Int minimum_size, Int natural_size) Veraltet.voidgetPreferredHeightForWidth(Widget widget, int width, Int minimum_height, Int natural_height) Veraltet.voidgetPreferredSize(Widget widget, Requisition minimum_size, Requisition natural_size) Veraltet.voidgetPreferredWidth(Widget widget, Int minimum_size, Int natural_size) Veraltet.voidgetPreferredWidthForHeight(Widget widget, int height, Int minimum_width, Int natural_width) Veraltet.intVeraltet.booleanVeraltet.intVeraltet.static longstatic TypeSystem.TypeSizebooleanVeraltet.booleanVeraltet.Connect to signal "editing-canceled".Connect to signal "editing-started".voidsetAlignment(float xalign, float yalign) Veraltet.voidsetFixedSize(int width, int height) Veraltet.voidsetIsExpanded(boolean is_expanded) Veraltet.voidsetIsExpander(boolean is_expander) Veraltet.voidsetPadding(int xpad, int ypad) Veraltet.voidsetSensitive(boolean sensitive) Veraltet.voidsetVisible(boolean visible) Veraltet.voidsnapshot(Snapshot snapshot, Widget widget, Rectangle background_area, Rectangle cell_area, int flags) Veraltet.startEditing(Event event, Widget widget, Str path, Rectangle background_area, Rectangle cell_area, int flags) Veraltet.startEditing(Event event, Widget widget, String path, Rectangle background_area, Rectangle cell_area, int flags) Veraltet.voidstopEditing(boolean canceled) Veraltet.Von Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrPropertyVon Klasse geerbte Methoden ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnrefVon Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacksVon Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNullVon Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitVon Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Felddetails
-
SIGNAL_ON_EDITING_CANCELED
- Siehe auch:
-
SIGNAL_ON_EDITING_STARTED
- Siehe auch:
-
-
Konstruktordetails
-
CellRenderer
-
-
Methodendetails
-
getClassHandler
-
activate
@Deprecated public boolean activate(@Nonnull Event event, @Nonnull Widget widget, @Nonnull Str path, @Nonnull Rectangle background_area, @Nonnull Rectangle cell_area, int flags) Veraltet.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.- Parameter:
event- a `GdkEvent`widget- widget that received the eventpath- widget-dependent string representation of the event location; e.g. for `GtkTreeView`, a string representation of `GtkTreePath`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- Gibt zurück:
- %TRUE if the event was consumed/handled
-
activate
@Deprecated public boolean activate(@Nonnull Event event, @Nonnull Widget widget, String path, @Nonnull Rectangle background_area, @Nonnull Rectangle cell_area, int flags) Veraltet.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.- Parameter:
event- a `GdkEvent`widget- widget that received the eventpath- widget-dependent string representation of the event location; e.g. for `GtkTreeView`, a string representation of `GtkTreePath`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- Gibt zurück:
- %TRUE if the event was consumed/handled
-
getAlignedArea
@Deprecated public void getAlignedArea(@Nonnull Widget widget, int flags, @Nonnull Rectangle cell_area, @Nonnull Rectangle aligned_area) Veraltet.Gets the aligned area used by @cell inside @cell_area. Used for finding
the appropriate edit and focus rectangle.- Parameter:
widget- the `GtkWidget` this cell will be rendering toflags- render flagscell_area- cell area which would be passed to gtk_cell_renderer_render()aligned_area- the return location for the space inside @cell_area that would actually be used to render.
-
getAlignment
Veraltet.Fills in @xalign and @yalign with the appropriate values of @cell.- Parameter:
xalign- location to fill in with the x alignment of the cellyalign- location to fill in with the y alignment of the cell
-
getFixedSize
Veraltet.Fills in @width and @height with the appropriate size of @cell.- Parameter:
width- location to fill in with the fixed width of the cellheight- location to fill in with the fixed height of the cell
-
getIsExpanded
Veraltet.Checks whether the given `GtkCellRenderer` is expanded.- Gibt zurück:
- %TRUE if the cell renderer is expanded
-
getIsExpander
Veraltet.Checks whether the given `GtkCellRenderer` is an expander.- Gibt zurück:
- %TRUE if @cell is an expander, and %FALSE otherwise
-
getPadding
Veraltet.Fills in @xpad and @ypad with the appropriate values of @cell.- Parameter:
xpad- location to fill in with the x padding of the cellypad- location to fill in with the y padding of the cell
-
getPreferredHeight
@Deprecated public void getPreferredHeight(@Nonnull Widget widget, @Nullable Int minimum_size, @Nullable Int natural_size) Veraltet.Retrieves a renderer’s natural size when rendered to @widget.- Parameter:
widget- the `GtkWidget` this cell will be rendering tominimum_size- location to store the minimum sizenatural_size- location to store the natural size
-
getPreferredHeightForWidth
@Deprecated public void getPreferredHeightForWidth(@Nonnull Widget widget, int width, @Nullable Int minimum_height, @Nullable Int natural_height) Veraltet.Retrieves a cell renderers’s minimum and natural height if it were rendered to
@widget with the specified @width.- Parameter:
widget- the `GtkWidget` this cell will be rendering towidth- the size which is available for allocationminimum_height- location for storing the minimum sizenatural_height- location for storing the preferred size
-
getPreferredSize
@Deprecated public void getPreferredSize(@Nonnull Widget widget, @Nullable Requisition minimum_size, @Nullable Requisition natural_size) Veraltet.Retrieves the minimum and natural size of a cell taking
into account the widget’s preference for height-for-width management.- Parameter:
widget- the `GtkWidget` this cell will be rendering tominimum_size- location for storing the minimum sizenatural_size- location for storing the natural size
-
getPreferredWidth
@Deprecated public void getPreferredWidth(@Nonnull Widget widget, @Nullable Int minimum_size, @Nullable Int natural_size) Veraltet.Retrieves a renderer’s natural size when rendered to @widget.- Parameter:
widget- the `GtkWidget` this cell will be rendering tominimum_size- location to store the minimum sizenatural_size- location to store the natural size
-
getPreferredWidthForHeight
@Deprecated public void getPreferredWidthForHeight(@Nonnull Widget widget, int height, @Nullable Int minimum_width, @Nullable Int natural_width) Veraltet.Retrieves a cell renderers’s minimum and natural width if it were rendered to
@widget with the specified @height.- Parameter:
widget- the `GtkWidget` this cell will be rendering toheight- the size which is available for allocationminimum_width- location for storing the minimum sizenatural_width- location for storing the preferred size
-
getRequestMode
Veraltet.Gets whether the cell renderer prefers a height-for-width layout
or a width-for-height layout.- Gibt zurück:
- The `GtkSizeRequestMode` preferred by this renderer.
-
getSensitive
Veraltet.Returns the cell renderer’s sensitivity.- Gibt zurück:
- %TRUE if the cell renderer is sensitive
-
getState
Veraltet.Translates the cell renderer state to `GtkStateFlags`,
based on the cell renderer and widget sensitivity, and
the given `GtkCellRenderer`State.- Parameter:
widget- a `GtkWidget`cell_state- cell renderer state- Gibt zurück:
- the widget state flags applying to @cell
-
getVisible
Veraltet.Returns the cell renderer’s visibility.- Gibt zurück:
- %TRUE if the cell renderer is visible
-
isActivatable
Veraltet.Checks whether the cell renderer can do something when activated.- Gibt zurück:
- %TRUE if the cell renderer can do anything when activated
-
setAlignment
Veraltet.Sets the renderer’s alignment within its available space.- Parameter:
xalign- the x alignment of the cell rendereryalign- the y alignment of the cell renderer
-
setFixedSize
Veraltet.Sets the renderer size to be explicit, independent of the properties set.- Parameter:
width- the width of the cell renderer, or -1height- the height of the cell renderer, or -1
-
setIsExpanded
Veraltet.Sets whether the given `GtkCellRenderer` is expanded.- Parameter:
is_expanded- whether @cell should be expanded
-
setIsExpander
Veraltet.Sets whether the given `GtkCellRenderer` is an expander.- Parameter:
is_expander- whether @cell is an expander
-
setPadding
Veraltet.Sets the renderer’s padding.- Parameter:
xpad- the x padding of the cell rendererypad- the y padding of the cell renderer
-
setSensitive
Veraltet.Sets the cell renderer’s sensitivity.- Parameter:
sensitive- the sensitivity of the cell
-
setVisible
Veraltet.Sets the cell renderer’s visibility.- Parameter:
visible- the visibility of the cell
-
snapshot
@Deprecated public void snapshot(@Nonnull Snapshot snapshot, @Nonnull Widget widget, @Nonnull Rectangle background_area, @Nonnull Rectangle cell_area, int flags) Veraltet.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.- Parameter:
snapshot- a `GtkSnapshot` to draw towidget- the widget owning @windowbackground_area- entire cell area (including tree expanders and maybe padding on the sides)cell_area- area normally rendered by a cell rendererflags- flags that affect rendering
-
startEditing
@Deprecated public CellEditable startEditing(@Nullable Event event, @Nonnull Widget widget, @Nonnull Str path, @Nonnull Rectangle background_area, @Nonnull Rectangle cell_area, int flags) Veraltet.Starts editing the contents of this @cell, through a new `GtkCellEditable`
widget created by the `GtkCellRenderer`Class.start_editing virtual function.- Parameter:
event- a `GdkEvent`widget- widget that received the eventpath- widget-dependent string representation of the event location; e.g. for `GtkTreeView`, a string representation of `GtkTreePath`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- Gibt zurück:
- A new `GtkCellEditable` for editing this @cell, or %NULL if editing is not possible
-
startEditing
@Deprecated public CellEditable startEditing(@Nullable Event event, @Nonnull Widget widget, String path, @Nonnull Rectangle background_area, @Nonnull Rectangle cell_area, int flags) Veraltet.Starts editing the contents of this @cell, through a new `GtkCellEditable`
widget created by the `GtkCellRenderer`Class.start_editing virtual function.- Parameter:
event- a `GdkEvent`widget- widget that received the eventpath- widget-dependent string representation of the event location; e.g. for `GtkTreeView`, a string representation of `GtkTreePath`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- Gibt zurück:
- A new `GtkCellEditable` for editing this @cell, or %NULL if editing is not possible
-
stopEditing
Veraltet.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`.- Parameter:
canceled- %TRUE if the editing has been canceled
-
onEditingCanceled
Connect to signal "editing-canceled".
SeeCellRenderer.OnEditingCanceled.onEditingCanceled()for signal description.
FieldSIGNAL_ON_EDITING_CANCELEDcontains original signal name and can be used as resource reference.- Parameter:
signal- callback function (lambda).- Gibt zurück:
SignalHandler. Can be used to disconnect signal and to release callback function.
-
onEditingStarted
Connect to signal "editing-started".
SeeCellRenderer.OnEditingStarted.onEditingStarted(ch.bailu.gtk.gtk.CellEditable, ch.bailu.gtk.type.Str)for signal description.
FieldSIGNAL_ON_EDITING_STARTEDcontains original signal name and can be used as resource reference.- Parameter:
signal- callback function (lambda).- Gibt zurück:
SignalHandler. Can be used to disconnect signal and to release callback function.
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-