Package org.gnome.gtk
Class ColorDialog
java.lang.Object
org.javagi.base.ProxyInstance
org.gnome.gobject.TypeInstance
org.gnome.gobject.GObject
org.gnome.gtk.ColorDialog
- All Implemented Interfaces:
Proxy
Asynchronous API to present a color chooser dialog.
GtkColorDialog collects the arguments that are needed to present
the dialog to the user, such as a title for the dialog and whether
it should be modal.
The dialog is shown with the chooseRgba(org.gnome.gtk.Window, org.gnome.gdk.RGBA, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)
function.
See ColorDialogButton for a convenient control
that uses GtkColorDialog and presents the results.
- Since:
- 4.10
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classColorDialog.Builder<B extends ColorDialog.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static classNested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new ColorDialog.ColorDialog(MemorySegment address) Create a ColorDialog proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected ColorDialogasParent()Returns this instance as if it were its parent type.static ColorDialog.Builder<? extends ColorDialog.Builder> builder()AColorDialog.Builderobject constructs aColorDialogwith the specified properties.voidchooseRgba(@Nullable Window parent, @Nullable RGBA initialColor, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Presents a color chooser dialog to the user.chooseRgbaFinish(AsyncResult result) booleangetModal()Returns whether the color chooser dialog blocks interaction with the parent window while it is presented.getTitle()Returns the title that will be shown on the color chooser dialog.static @Nullable TypegetType()Get the GType of the ColorDialog classbooleanReturns whether colors may have alpha.voidsetModal(boolean modal) Sets whether the color chooser dialog blocks interaction with the parent window while it is presented.voidSets the title that will be shown on the color chooser dialog.voidsetWithAlpha(boolean withAlpha) Sets whether colors may have alpha.Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getMemoryLayout, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newv, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withPropertiesMethods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
ColorDialog
Create a ColorDialog proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
ColorDialog
public ColorDialog()Creates a new ColorDialog.
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuperkeyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName(). This will call the native function pointer of this virtual method in the typeclass of the parent type. -
chooseRgba
public void chooseRgba(@Nullable Window parent, @Nullable RGBA initialColor, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Presents a color chooser dialog to the user.- Parameters:
parent- the parent windowinitialColor- the color to select initiallycancellable- a cancellable to cancel the operationcallback- a callback to call when the operation is complete- Since:
- 4.10
-
chooseRgbaFinish
Finishes thechooseRgba(org.gnome.gtk.Window, org.gnome.gdk.RGBA, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)callNote that this function returns a
Gtk.DialogError.DISMISSEDerror if the user cancels the dialog.- Parameters:
result- the result- Returns:
- the selected color
- Throws:
GErrorException- seeGError- Since:
- 4.10
-
getModal
public boolean getModal()Returns whether the color chooser dialog blocks interaction with the parent window while it is presented.- Returns:
- true if the color chooser dialog is modal
- Since:
- 4.10
-
getTitle
Returns the title that will be shown on the color chooser dialog.- Returns:
- the title
- Since:
- 4.10
-
getWithAlpha
public boolean getWithAlpha()Returns whether colors may have alpha.- Returns:
- true if colors may have alpha
- Since:
- 4.10
-
setModal
public void setModal(boolean modal) Sets whether the color chooser dialog blocks interaction with the parent window while it is presented.- Parameters:
modal- the new value- Since:
- 4.10
-
setTitle
Sets the title that will be shown on the color chooser dialog.- Parameters:
title- the new title- Since:
- 4.10
-
setWithAlpha
public void setWithAlpha(boolean withAlpha) Sets whether colors may have alpha.- Parameters:
withAlpha- the new value- Since:
- 4.10
-
builder
AColorDialog.Builderobject constructs aColorDialogwith the specified properties. Use the variousset...()methods to set properties, and finish construction withColorDialog.Builder.build().- Returns:
- the builder object
-