Package org.gnome.adw
Interface TabView.ClosePageCallback
- All Superinterfaces:
FunctionPointer
- Enclosing class:
TabView
- 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
ClosePageCallback
callback.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Emitted afterTabView.closePage(org.gnome.adw.TabPage)
has been called forpage
.default MemorySegment
toCallback
(Arena arena) Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
method.default int
upcall
(MemorySegment sourceTabView, MemorySegment page) Theupcall
method is called from native code.
-
Method Details
-
run
Emitted afterTabView.closePage(org.gnome.adw.TabPage)
has been called forpage
.The handler is expected to call
TabView.closePageFinish(org.gnome.adw.TabPage, boolean)
to confirm or reject the closing.The default handler will immediately confirm closing for non-pinned pages, or reject it for pinned pages, equivalent to the following example:
static gboolean close_page_cb (AdwTabView *view, AdwTabPage *page, gpointer user_data) { adw_tab_view_close_page_finish (view, page, !adw_tab_page_get_pinned (page)); return GDK_EVENT_STOP; }
The
TabView.closePageFinish(org.gnome.adw.TabPage, boolean)
call doesn't have to happen inside the handler, so can be used to do asynchronous checks before confirming the closing.A typical reason to connect to this signal is to show a confirmation dialog for closing a tab.
The signal handler should return
GDK_EVENT_STOP
to stop propagation orGDK_EVENT_CONTINUE
to invoke the default handler. -
upcall
Theupcall
method is called from native code. The parameters are marshaled andrun(org.gnome.adw.TabPage)
is executed. -
toCallback
Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
method.- Specified by:
toCallback
in interfaceFunctionPointer
- Parameters:
arena
- the function pointer will be allocated in this arena- Returns:
- the native function pointer
-