Class FlowBoxChild

All Implemented Interfaces:
Accessible, Buildable, ConstraintTarget, Proxy

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

The kind of widget that can be added to a GtkFlowBox.

FlowBox will automatically wrap its children in a GtkFlowBoxChild when necessary.

  • Constructor Details

    • FlowBoxChild

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

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

    • getType

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

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

      protected FlowBoxChild 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
    • changed

      public void changed()

      Marks this FlowBoxChild as changed, causing any state that depends on this to be updated.

      This affects sorting and filtering.

      Note that calls to this method must be in sync with the data used for the sorting and filtering functions. For instance, if the list is mirroring some external data set, and two children changed in the external data set when you call gtk_flow_box_child_changed() on the first child, the sort function must only read the new data for the first of the two changed children, otherwise the resorting of the children will be wrong.

      This generally means that if you don’t fully control the data model, you have to duplicate the data that affects the sorting and filtering functions into the widgets themselves.

      Another alternative is to call FlowBox.invalidateSort() on any model change, but that is more expensive.

    • getChild

      public @Nullable Widget getChild()
      Gets the child widget of self.
      Returns:
      the child widget of this FlowBoxChild
    • getIndex

      public int getIndex()
      Gets the current index of the this FlowBoxChild in its GtkFlowBox container.
      Returns:
      the index of the child, or -1 if the this FlowBoxChild is not in a flow box
    • isSelected

      public boolean isSelected()
      Returns whether the this FlowBoxChild is currently selected in its GtkFlowBox container.
      Returns:
      true if this FlowBoxChild is selected
    • setChild

      public void setChild(@Nullable Widget child)
      Sets the child widget of self.
      Parameters:
      child - the child widget
    • activate

      protected void activate()
    • onActivate

      Emitted when the user activates a child widget in a GtkFlowBox.

      This can happen either by clicking or double-clicking, or via a keybinding.

      This is a keybinding signal, but it can be used by applications for their own purposes.

      The default bindings are Space and Enter.

      Parameters:
      handler - the signal handler
      Returns:
      a signal handler ID to keep track of the signal connection
      See Also:
    • emitActivate

      public void emitActivate()
      Emits the "activate" signal. See onActivate(FlowBoxChild.ActivateCallback).
    • builder

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