Class Spinner

All Implemented Interfaces:
Accessible, Buildable, ConstraintTarget, Proxy

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

Displays an icon-size spinning animation.

It is often used as an alternative to a ProgressBar for displaying indefinite activity, instead of actual progress.

An example GtkSpinner

To start the animation, use start(), to stop it use stop().

CSS nodes

GtkSpinner has a single CSS node with the name spinner. When the animation is active, the :checked pseudoclass is added to this node.

Accessibility

GtkSpinner uses the Gtk.AccessibleRole.progress_bar role.

  • Constructor Details

    • Spinner

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

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

    • getType

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

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

      protected Spinner 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
    • getSpinning

      public boolean getSpinning()
      Returns whether the spinner is spinning.
      Returns:
      true if the spinner is active
    • setSpinning

      public void setSpinning(boolean spinning)
      Sets the activity of the spinner.
      Parameters:
      spinning - whether the spinner should be spinning
    • start

      public void start()
      Starts the animation of the spinner.
    • stop

      public void stop()
      Stops the animation of the spinner.
    • builder

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