Package ch.bailu.gtk.gtk
Class ListItem
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gtk.ListItem
- All Implemented Interfaces:
PointerInterface
`GtkListItem` is used by list widgets to represent items in a `GListModel`.
The `GtkListItem`s are managed by the list widget (with its factory)
and cannot be created by applications, but they need to be populated
by application code. This is done by calling [method@Gtk.ListItem.set_child].
`GtkListItem`s exist in 2 stages:
1. The unbound stage where the listitem is not currently connected to
an item in the list. In that case, the [property@Gtk.ListItem:item]
property is set to %NULL.
2. The bound stage where the listitem references an item from the list.
The [property@Gtk.ListItem:item] property is not %NULL.
The `GtkListItem`s are managed by the list widget (with its factory)
and cannot be created by applications, but they need to be populated
by application code. This is done by calling [method@Gtk.ListItem.set_child].
`GtkListItem`s exist in 2 stages:
1. The unbound stage where the listitem is not currently connected to
an item in the list. In that case, the [property@Gtk.ListItem:item]
property is set to %NULL.
2. The bound stage where the listitem references an item from the list.
The [property@Gtk.ListItem:item] property is not %NULL.
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if a list item has been set to be activatable via
gtk_list_item_set_activatable().getChild()
Gets the child previously set via gtk_list_item_set_child() or
%NULL if none was set.static ClassHandler
static int
getItem()
Gets the model item that associated with @self.static long
static TypeSystem.TypeSize
int
Gets the position in the model that @self currently displays.boolean
Checks if a list item has been set to be selectable via
gtk_list_item_set_selectable().boolean
Checks if the item is displayed as selected.static long
static TypeSystem.TypeSize
void
setActivatable
(boolean activatable) Sets @self to be activatable.void
Sets the child to be used for this listitem.void
setSelectable
(boolean selectable) Sets @self to be selectable.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
-
ListItem
-
-
Method Details
-
getClassHandler
-
getActivatable
public boolean getActivatable()Checks if a list item has been set to be activatable via
gtk_list_item_set_activatable().- Returns:
- %TRUE if the item is activatable
-
getChild
Gets the child previously set via gtk_list_item_set_child() or
%NULL if none was set.- Returns:
- The child
-
getItem
Gets the model item that associated with @self.
If @self is unbound, this function returns %NULL.- Returns:
- The item displayed
-
getPosition
public int getPosition()Gets the position in the model that @self currently displays.
If @self is unbound, %GTK_INVALID_LIST_POSITION is returned.- Returns:
- The position of this item
-
getSelectable
public boolean getSelectable()Checks if a list item has been set to be selectable via
gtk_list_item_set_selectable().
Do not confuse this function with [method@Gtk.ListItem.get_selected].- Returns:
- %TRUE if the item is selectable
-
getSelected
public boolean getSelected()Checks if the item is displayed as selected.
The selected state is maintained by the liste widget and its model
and cannot be set otherwise.- Returns:
- %TRUE if the item is selected.
-
setActivatable
public void setActivatable(boolean activatable) Sets @self to be activatable.
If an item is activatable, double-clicking on the item, using
the Return key or calling gtk_widget_activate() will activate
the item. Activating instructs the containing view to handle
activation. `GtkListView` for example will be emitting the
[signal@Gtk.ListView::activate] signal.
By default, list items are activatable.- Parameters:
activatable
- if the item should be activatable
-
setChild
Sets the child to be used for this listitem.
This function is typically called by applications when
setting up a listitem so that the widget can be reused when
binding it multiple times.- Parameters:
child
- The list item's child or %NULL to unset
-
setSelectable
public void setSelectable(boolean selectable) Sets @self to be selectable.
If an item is selectable, clicking on the item or using the keyboard
will try to select or unselect the item. If this succeeds is up to
the model to determine, as it is managing the selected state.
Note that this means that making an item non-selectable has no
influence on the selected state at all. A non-selectable item
may still be selected.
By default, list items are selectable. When rebinding them to
a new item, they will also be reset to be selectable by GTK.- Parameters:
selectable
- if the item should be selectable
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-