Class PopoverBin

All Implemented Interfaces:
Accessible, Buildable, ConstraintTarget, Proxy

@Generated("org.javagi.JavaGI") public final class PopoverBin extends Widget implements Accessible, Buildable, ConstraintTarget

A single child container with a popover.

You should use GtkPopoverBin whenever you need to present a Popover to the user.

Actions

GtkPopoverBin defines the menu.popup action, which can be activated to present the popover to the user.

CSS nodes

GtkPopoverBin has a single CSS node with the name popoverbin.

Since:
4.22
  • Constructor Details

    • PopoverBin

      public PopoverBin(MemorySegment address)
      Create a PopoverBin instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • PopoverBin

      public PopoverBin()
      Create a new PopoverBin.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the PopoverBin class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected PopoverBin asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class Widget
      Returns:
      the instance as if it were its parent type
    • getChild

      public @Nullable Widget getChild()
      Retrieves the child widget of the popover bin.
      Returns:
      the child widget
      Since:
      4.22
    • getHandleInput

      public boolean getHandleInput()
    • getMenuModel

      public @Nullable MenuModel getMenuModel()
      Retrieves the menu model set using setMenuModel(MenuModel).
      Returns:
      the menu model for the popover
      Since:
      4.22
    • getPopover

      public @Nullable Popover getPopover()
      Retrieves the GtkPopover set using setPopover(Popover).
      Returns:
      a popover widget
      Since:
      4.22
    • popdown

      public void popdown()

      Hides the popover from the user.

      See: popup()

      Since:
      4.22
    • popup

      public void popup()

      Presents the popover to the user.

      Use setPopover(Popover) or setMenuModel(MenuModel) to define the popover.

      See: popdown()

      Since:
      4.22
    • setChild

      public void setChild(@Nullable Widget child)
      Sets the child of the popover bin.
      Parameters:
      child - the child of the popover bin
      Since:
      4.22
    • setHandleInput

      public void setHandleInput(boolean handleInput)

      Enables or disables input handling.

      If enabled, the popover bin will pop up the popover on right-click or long press, as expected for a context menu.

      Parameters:
      handleInput - whether to handle input
      Since:
      4.22
    • setMenuModel

      public void setMenuModel(@Nullable MenuModel model)

      Sets the menu model used to create the popover that will be presented when calling popup().

      If model is NULL, the popover will be unset.

      A Popover will be created from the menu model with PopoverMenu.fromModel(MenuModel). Actions will be connected as documented for this function.

      If Gtk.PopoverBin:popover is already set, it will be dissociated from the popover bin, and the property is set to NULL.

      See: setPopover(Popover)

      Parameters:
      model - a menu model
      Since:
      4.22
    • setPopover

      public void setPopover(@Nullable Popover popover)

      Sets the GtkPopover that will be presented when calling popup().

      If popover is NULL, the popover will be unset.

      If Gtk.PopoverBin:menu-model is set before calling this function, then the menu model property will be unset.

      See: setMenuModel(MenuModel)

      Parameters:
      popover - a GtkPopover
      Since:
      4.22
    • builder

      public static PopoverBin.Builder<? extends PopoverBin.Builder> builder()
      A PopoverBin.Builder object constructs a PopoverBin with the specified properties. Use the various set...() methods to set properties, and finish construction with PopoverBin.Builder.build().
      Returns:
      the builder object