Class SignalListItemFactory
- All Implemented Interfaces:
Proxy
Emits signals to manage listitems.
Signals are emitted for every listitem in the same order:
-
Gtk.SignalListItemFactory::setupis emitted to set up permanent things on the listitem. This usually means constructing the widgets used in the row and adding them to the listitem. -
Gtk.SignalListItemFactory::bindis emitted to bind the item passed viaGtk.ListItem:itemto the widgets that have been created in step 1 or to add item-specific widgets. Signals are connected to listen to changes - both to changes in the item to update the widgets or to changes in the widgets to update the item. After this signal has been called, the listitem may be shown in a list widget. -
Gtk.SignalListItemFactory::unbindis emitted to undo everything done in step 2. Usually this means disconnecting signal handlers. Once this signal has been called, the listitem will no longer be used in a list widget. -
Gtk.SignalListItemFactory::bindandGtk.SignalListItemFactory::unbindmay be emitted multiple times again to bind the listitem for use with new items. By reusing listitems, potentially costly setup can be avoided. However, it means code needs to make sure to properly clean up the listitem in step 3 so that no information from the previous use leaks into the next one. -
Gtk.SignalListItemFactory::teardownis emitted to allow undoing the effects ofGtk.SignalListItemFactory::setup. After this signal was emitted on a listitem, the listitem will be destroyed and not be used again.
Note that during the signal emissions, changing properties on the listitems passed will not trigger notify signals as the listitem's notifications are frozen. See GObject#freezeNotify for details.
For tracking changes in other properties in the listitem, the
::notify signal is recommended. The signal can be connected in the
Gtk.SignalListItemFactory::setup signal and removed again during
Gtk.SignalListItemFactory::teardown.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFunctional interface declaration of theBindCallbackcallback.static classInner class implementing a builder pattern to construct a GObject with properties.static interfaceFunctional interface declaration of theSetupCallbackcallback.static classstatic interfaceFunctional interface declaration of theTeardownCallbackcallback.static interfaceFunctional interface declaration of theUnbindCallbackcallback.Nested classes/interfaces inherited from class ListItemFactory
ListItemFactory.ListItemFactoryClassNested classes/interfaces inherited from class GObject
GObject.NotifyCallback, GObject.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new SignalListItemFactory.SignalListItemFactory(MemorySegment address) Create a SignalListItemFactory instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected SignalListItemFactoryasParent()Return this instance as if it were its parent type.static SignalListItemFactory.Builder<? extends SignalListItemFactory.Builder> builder()ASignalListItemFactory.Builderobject constructs aSignalListItemFactorywith the specified properties.voidEmits the "bind" signal.voidEmits the "setup" signal.voidemitTeardown(@Nullable GObject object) Emits the "teardown" signal.voidemitUnbind(@Nullable GObject object) Emits the "unbind" signal.static MemoryLayoutThe memory layout of the native struct.static @Nullable TypegetType()Get the GType of the SignalListItemFactory class.onBind(SignalListItemFactory.BindCallback handler) Emitted when an object has been bound to an item.Emitted when a newly created listitem needs to be prepared for use.Emitted when an object is about to be destroyed.Emitted when an object has been unbound from its item.Methods inherited from class GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newv, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withPropertiesMethods inherited from class TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
SignalListItemFactory
Create a SignalListItemFactory instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
SignalListItemFactory
public SignalListItemFactory()Create a new SignalListItemFactory.
-
-
Method Details
-
getType
Get the GType of the SignalListItemFactory class.- Returns:
- the GType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Return this instance as if it were its parent type. Comparable to the Javasuperkeyword, but ensures the parent typeclass is also used in native code.- Overrides:
asParentin classListItemFactory- Returns:
- the instance as if it were its parent type
-
onBind
public SignalConnection<SignalListItemFactory.BindCallback> onBind(SignalListItemFactory.BindCallback handler) Emitted when an object has been bound to an item.
The handler for this signal must set to populate the listitem with widgets.
After this signal was emitted, the object might be shown in a
ListViewor other widget.The
Gtk.SignalListItemFactory::unbindsignal is the opposite of this signal and can be used to undo everything done in this signal.- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitBind
Emits the "bind" signal. SeeonBind(SignalListItemFactory.BindCallback). -
onSetup
public SignalConnection<SignalListItemFactory.SetupCallback> onSetup(SignalListItemFactory.SetupCallback handler) Emitted when a newly created listitem needs to be prepared for use.
It is the first signal emitted for every listitem.
The handler for this signal must call
ListItem.setChild(Widget)to populate the listitem with widgets.The
Gtk.SignalListItemFactory::teardownsignal is the opposite of this signal and can be used to undo everything done in this signal.- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitSetup
Emits the "setup" signal. SeeonSetup(SignalListItemFactory.SetupCallback). -
onTeardown
public SignalConnection<SignalListItemFactory.TeardownCallback> onTeardown(SignalListItemFactory.TeardownCallback handler) Emitted when an object is about to be destroyed.
It is the last signal ever emitted for this
object.This signal is the opposite of the
Gtk.SignalListItemFactory::setupsignal and should be used to undo everything done in that signal.- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitTeardown
Emits the "teardown" signal. SeeonTeardown(SignalListItemFactory.TeardownCallback). -
onUnbind
public SignalConnection<SignalListItemFactory.UnbindCallback> onUnbind(SignalListItemFactory.UnbindCallback handler) Emitted when an object has been unbound from its item.
This happens for example when a listitem was removed from use in a list widget and its
Gtk.ListItem:itemis about to be unset.This signal is the opposite of the
Gtk.SignalListItemFactory::bindsignal and should be used to undo everything done in that signal.- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitUnbind
Emits the "unbind" signal. SeeonUnbind(SignalListItemFactory.UnbindCallback). -
builder
ASignalListItemFactory.Builderobject constructs aSignalListItemFactorywith the specified properties. Use the variousset...()methods to set properties, and finish construction withSignalListItemFactory.Builder.build().- Returns:
- the builder object
-