Class ColorButton

All Implemented Interfaces:
Accessible, Buildable, ColorChooser, ConstraintTarget, Proxy

@Generated("org.javagi.JavaGI") @Deprecated public class ColorButton extends Widget implements Accessible, Buildable, ColorChooser, ConstraintTarget
Deprecated.
Use ColorDialogButton instead

The GtkColorButton allows to open a color chooser dialog to change the color.

An example GtkColorButton

It is suitable widget for selecting a color in a preference dialog.

CSS nodes

colorbutton
╰── button.color
    ╰── [content]

GtkColorButton has a single CSS node with name colorbutton which contains a button node. To differentiate it from a plain GtkButton, it gets the .color style class.

  • Constructor Details

    • ColorButton

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

      public ColorButton()
      Deprecated.
      Create a new ColorButton.
  • Method Details

    • getType

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

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

      protected ColorButton asParent()
      Deprecated.
      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
    • withRgba

      public static ColorButton withRgba(RGBA rgba)
      Deprecated.
      Creates a new color button showing the given color.
      Parameters:
      rgba - A GdkRGBA to set the current color with
      Returns:
      a new color button
    • getModal

      @Deprecated public boolean getModal()
      Deprecated.
      Use ColorDialogButton instead
      Gets whether the dialog is modal.
      Returns:
      true if the dialog is modal
    • getTitle

      @Deprecated public String getTitle()
      Deprecated.
      Use ColorDialogButton instead
      Gets the title of the color chooser dialog.
      Returns:
      An internal string, do not free the return value
    • setModal

      @Deprecated public void setModal(boolean modal)
      Deprecated.
      Use ColorDialogButton instead
      Sets whether the dialog should be modal.
      Parameters:
      modal - true to make the dialog modal
    • setTitle

      @Deprecated public void setTitle(String title)
      Deprecated.
      Use ColorDialogButton instead
      Sets the title for the color chooser dialog.
      Parameters:
      title - String containing new window title
    • onActivate

      Deprecated.

      Emitted to when the color button is activated.

      The ::activate signal on GtkMenuButton is an action signal and emitting it causes the button to pop up its dialog.

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

      public void emitActivate()
      Deprecated.
      Emits the "activate" signal. See onActivate(ColorButton.ActivateCallback).
    • onColorSet

      Deprecated.

      Emitted when the user selects a color.

      When handling this signal, use ColorChooser.getRgba(RGBA) to find out which color was just selected.

      Note that this signal is only emitted when the user changes the color. If you need to react to programmatic color changes as well, use the notify::rgba signal.

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

      public void emitColorSet()
      Deprecated.
      Emits the "color-set" signal. See onColorSet(ColorButton.ColorSetCallback).
    • builder

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