Package ch.bailu.gtk.gtk
Class CellView
- All Implemented Interfaces:
PointerInterface
A widget displaying a single row of a GtkTreeModel
A `GtkCellView` displays a single row of a `GtkTreeModel` using a `GtkCellArea`
and `GtkCellAreaContext`. A `GtkCellAreaContext` can be provided to the
`GtkCellView` at construction time in order to keep the cellview in context
of a group of cell views, this ensures that the renderers displayed will
be properly aligned with each other (like the aligned cells in the menus
of `GtkComboBox`).
`GtkCellView` is `GtkOrientable` in order to decide in which orientation
the underlying `GtkCellAreaContext` should be allocated. Taking the `GtkComboBox`
menu as an example, cellviews should be oriented horizontally if the menus are
listed top-to-bottom and thus all share the same width but may have separate
individual heights (left-to-right menus should be allocated vertically since
they all share the same height but may have variable widths).
# CSS nodes
GtkCellView has a single CSS node with name cellview.
A `GtkCellView` displays a single row of a `GtkTreeModel` using a `GtkCellArea`
and `GtkCellAreaContext`. A `GtkCellAreaContext` can be provided to the
`GtkCellView` at construction time in order to keep the cellview in context
of a group of cell views, this ensures that the renderers displayed will
be properly aligned with each other (like the aligned cells in the menus
of `GtkComboBox`).
`GtkCellView` is `GtkOrientable` in order to decide in which orientation
the underlying `GtkCellAreaContext` should be allocated. Taking the `GtkComboBox`
menu as an example, cellviews should be oriented horizontally if the menus are
listed top-to-bottom and thus all share the same width but may have separate
individual heights (left-to-right menus should be allocated vertically since
they all share the same height but may have variable widths).
# CSS nodes
GtkCellView has a single CSS node with name cellview.
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.bailu.gtk.gtk.Widget
Widget.OnDestroy, Widget.OnDestroyNotify, Widget.OnDirectionChanged, Widget.OnHide, Widget.OnKeynavFailed, Widget.OnMap, Widget.OnMnemonicActivate, Widget.OnMoveFocus, Widget.OnQueryTooltip, Widget.OnRealize, Widget.OnShow, Widget.OnStateFlagsChanged, Widget.OnTickCallback, Widget.OnUnmap, Widget.OnUnrealize
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Fields inherited from class ch.bailu.gtk.gtk.Widget
SIGNAL_ON_DESTROY, SIGNAL_ON_DIRECTION_CHANGED, SIGNAL_ON_HIDE, SIGNAL_ON_KEYNAV_FAILED, SIGNAL_ON_MAP, SIGNAL_ON_MNEMONIC_ACTIVATE, SIGNAL_ON_MOVE_FOCUS, SIGNAL_ON_QUERY_TOOLTIP, SIGNAL_ON_REALIZE, SIGNAL_ON_SHOW, SIGNAL_ON_STATE_FLAGS_CHANGED, SIGNAL_ON_UNMAP, SIGNAL_ON_UNREALIZE
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
ConstructorDescriptionCellView()
Creates a new `GtkCellView` widget.CellView
(PointerContainer pointer) -
Method Summary
Modifier and TypeMethodDescriptionImplements interfaceAccessible
.Implements interfaceBuildable
.Implements interfaceCellLayout
.Implements interfaceConstraintTarget
.Implements interfaceOrientable
.static ClassHandler
Returns a `GtkTreePath` referring to the currently
displayed row.boolean
Gets whether @cell_view is configured to draw all of its
cells in a sensitive state.boolean
Gets whether @cell_view is configured to request space
to fit the entire `GtkTreeModel`.static int
getModel()
Returns the model for @cell_view.static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
static CellView
newWithContextCellView
(CellArea area, CellAreaContext context) Creates a new `GtkCellView` widget with a specific `GtkCellArea`
to layout cells and a specific `GtkCellAreaContext`.static CellView
newWithMarkupCellView
(Str markup) Creates a new `GtkCellView` widget, adds a `GtkCellRendererText`
to it, and makes it show @markup.static CellView
newWithMarkupCellView
(String markup) Creates a new `GtkCellView` widget, adds a `GtkCellRendererText`
to it, and makes it show @markup.static CellView
newWithTextCellView
(Str text) Creates a new `GtkCellView` widget, adds a `GtkCellRendererText`
to it, and makes it show @text.static CellView
newWithTextCellView
(String text) Creates a new `GtkCellView` widget, adds a `GtkCellRendererText`
to it, and makes it show @text.static CellView
newWithTextureCellView
(Texture texture) Creates a new `GtkCellView` widget, adds a `GtkCellRendererPixbuf`
to it, and makes it show @texture.void
setDisplayedRow
(TreePath path) Sets the row of the model that is currently displayed
by the `GtkCellView`.void
setDrawSensitive
(boolean draw_sensitive) Sets whether @cell_view should draw all of its
cells in a sensitive state, this is used by `GtkComboBox` menus
to ensure that rows with insensitive cells that contain
children appear sensitive in the parent menu item.void
setFitModel
(boolean fit_model) Sets whether @cell_view should request space to fit the entire `GtkTreeModel`.void
Sets the model for @cell_view.Methods inherited from class ch.bailu.gtk.gtk.Widget
actionSetEnabled, actionSetEnabled, activate, activateAction, activateAction, activateActionVariant, activateActionVariant, activateDefault, addController, addCssClass, addCssClass, addMnemonicLabel, addTickCallback, allocate, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getCanFocus, getCanTarget, getChildVisible, getClipboard, getCssClasses, getCssName, getCursor, getDefaultDirection, getDirection, getDisplay, getFirstChild, getFocusable, getFocusChild, getFocusOnClick, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth, grabFocus, hasCssClass, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, observeChildren, observeControllers, onDestroy, onDirectionChanged, onHide, onKeynavFailed, onMap, onMnemonicActivate, onMoveFocus, onQueryTooltip, onRealize, onShow, onStateFlagsChanged, onUnmap, onUnrealize, pick, queueAllocate, queueDraw, queueResize, realize, removeController, removeCssClass, removeCssClass, removeMnemonicLabel, removeTickCallback, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setCursorFromName, setDefaultDirection, setDirection, setFocusable, setFocusChild, setFocusOnClick, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setName, setOpacity, setOverflow, setParent, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipMarkup, setTooltipText, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, shouldLayout, show, sizeAllocate, snapshotChild, triggerTooltipQuery, unmap, unparent, unrealize, unsetStateFlags
Methods inherited from class 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, weakUnref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Constructor Details
-
CellView
-
CellView
public CellView()Creates a new `GtkCellView` widget.
-
-
Method Details
-
getClassHandler
-
newWithContextCellView
public static CellView newWithContextCellView(@Nonnull CellArea area, @Nonnull CellAreaContext context) Creates a new `GtkCellView` widget with a specific `GtkCellArea`
to layout cells and a specific `GtkCellAreaContext`.
Specifying the same context for a handful of cells lets
the underlying area synchronize the geometry for those cells,
in this way alignments with cellviews for other rows are
possible.- Parameters:
area
- the `GtkCellArea` to layout cellscontext
- the `GtkCellAreaContext` in which to calculate cell geometry- Returns:
- A newly created `GtkCellView` widget.
-
newWithMarkupCellView
Creates a new `GtkCellView` widget, adds a `GtkCellRendererText`
to it, and makes it show @markup. The text can be marked up with
the [Pango text markup language](https://docs.gtk.org/Pango/pango_markup.html).- Parameters:
markup
- the text to display in the cell view- Returns:
- A newly created `GtkCellView` widget.
-
newWithMarkupCellView
Creates a new `GtkCellView` widget, adds a `GtkCellRendererText`
to it, and makes it show @markup. The text can be marked up with
the [Pango text markup language](https://docs.gtk.org/Pango/pango_markup.html).- Parameters:
markup
- the text to display in the cell view- Returns:
- A newly created `GtkCellView` widget.
-
newWithTextCellView
Creates a new `GtkCellView` widget, adds a `GtkCellRendererText`
to it, and makes it show @text.- Parameters:
text
- the text to display in the cell view- Returns:
- A newly created `GtkCellView` widget.
-
newWithTextCellView
Creates a new `GtkCellView` widget, adds a `GtkCellRendererText`
to it, and makes it show @text.- Parameters:
text
- the text to display in the cell view- Returns:
- A newly created `GtkCellView` widget.
-
newWithTextureCellView
Creates a new `GtkCellView` widget, adds a `GtkCellRendererPixbuf`
to it, and makes it show @texture.- Parameters:
texture
- the image to display in the cell view- Returns:
- A newly created `GtkCellView` widget.
-
getDisplayedRow
Returns a `GtkTreePath` referring to the currently
displayed row. If no row is currently displayed,
%NULL is returned.- Returns:
- the currently displayed row
-
getDrawSensitive
public boolean getDrawSensitive()Gets whether @cell_view is configured to draw all of its
cells in a sensitive state.- Returns:
- whether @cell_view draws all of its cells in a sensitive state
-
getFitModel
public boolean getFitModel()Gets whether @cell_view is configured to request space
to fit the entire `GtkTreeModel`.- Returns:
- whether @cell_view requests space to fit the entire `GtkTreeModel`.
-
getModel
Returns the model for @cell_view. If no model is used %NULL is
returned.- Returns:
- a `GtkTreeModel` used
-
setDisplayedRow
Sets the row of the model that is currently displayed
by the `GtkCellView`. If the path is unset, then the
contents of the cellview “stick” at their last value;
this is not normally a desired result, but may be
a needed intermediate state if say, the model for
the `GtkCellView` becomes temporarily empty.- Parameters:
path
- a `GtkTreePath` or %NULL to unset.
-
setDrawSensitive
public void setDrawSensitive(boolean draw_sensitive) Sets whether @cell_view should draw all of its
cells in a sensitive state, this is used by `GtkComboBox` menus
to ensure that rows with insensitive cells that contain
children appear sensitive in the parent menu item.- Parameters:
draw_sensitive
- whether to draw all cells in a sensitive state.
-
setFitModel
public void setFitModel(boolean fit_model) Sets whether @cell_view should request space to fit the entire `GtkTreeModel`.
This is used by `GtkComboBox` to ensure that the cell view displayed on
the combo box’s button always gets enough space and does not resize
when selection changes.- Parameters:
fit_model
- whether @cell_view should request space for the whole model.
-
setModel
Sets the model for @cell_view. If @cell_view already has a model
set, it will remove it before setting the new model. If @model is
%NULL, then it will unset the old model.- Parameters:
model
- a `GtkTreeModel`
-
asAccessible
Implements interfaceAccessible
. Call this to get access to interface functions.- Overrides:
asAccessible
in classWidget
- Returns:
Accessible
-
asBuildable
Implements interfaceBuildable
. Call this to get access to interface functions.- Overrides:
asBuildable
in classWidget
- Returns:
Buildable
-
asCellLayout
Implements interfaceCellLayout
. Call this to get access to interface functions.- Returns:
CellLayout
-
asConstraintTarget
Implements interfaceConstraintTarget
. Call this to get access to interface functions.- Overrides:
asConstraintTarget
in classWidget
- Returns:
ConstraintTarget
-
asOrientable
Implements interfaceOrientable
. Call this to get access to interface functions.- Returns:
Orientable
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-