Interface TabView.OnClosePage

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.

@FunctionalInterface public static interface TabView.OnClosePage
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Emitted after [method@TabView.close_page] has been called for @page.
  • Method Details

    • onClosePage

      boolean onClosePage(@Nonnull TabPage page)
      Emitted after [method@TabView.close_page] has been called for @page.

      The handler is expected to call [method@TabView.close_page_finish] 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:

      ```c
      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 [method@TabView.close_page_finish] 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.
      Parameters:
      page - a page of @self
      Returns: