Package org.gnome.gtk
Interface Switch.StateSetCallback
- All Superinterfaces:
FunctionPointer
- Enclosing class:
Switch
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Functional interface declaration of the
StateSetCallback
callback.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
run
(boolean state) Emitted to change the underlying state.default MemorySegment
toCallback
(Arena arena) Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, int)
method.default int
upcall
(MemorySegment sourceSwitch, int state) Theupcall
method is called from native code.
-
Method Details
-
run
boolean run(boolean state) Emitted to change the underlying state.The ::state-set signal is emitted when the user changes the switch position. The default handler calls
Switch.setState(boolean)
with the value ofstate
.To implement delayed state change, applications can connect to this signal, initiate the change of the underlying state, and call
Switch.setState(boolean)
when the underlying state change is complete. The signal handler should returntrue
to prevent the default handler from running. -
upcall
Theupcall
method is called from native code. The parameters are marshaled andrun(boolean)
is executed. -
toCallback
Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, int)
method.- Specified by:
toCallback
in interfaceFunctionPointer
- Parameters:
arena
- the function pointer will be allocated in this arena- Returns:
- the native function pointer
-