Package org.gnome.gtk
Class ColorDialog
java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.gnome.gobject.TypeInstance
org.gnome.gobject.GObject
org.gnome.gtk.ColorDialog
- All Implemented Interfaces:
Proxy
A
GtkColorDialog
object collects the arguments that
are needed to present a color chooser 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.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
ColorDialog.Builder<B extends ColorDialog.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.static class
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
-
Constructor Summary
ConstructorDescriptionCreates a newGtkColorDialog
object.ColorDialog
(MemorySegment address) Create a ColorDialog proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected ColorDialog
asParent()
Returns this instance as if it were its parent type.static ColorDialog.Builder
<? extends ColorDialog.Builder> builder()
AColorDialog.Builder
object constructs aColorDialog
with the specified properties.void
chooseRgba
(@Nullable Window parent, @Nullable RGBA initialColor, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) This function initiates a color choice operation by presenting a color chooser dialog to the user.chooseRgbaFinish
(AsyncResult result) Finishes thechooseRgba(org.gnome.gtk.Window, org.gnome.gdk.RGBA, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)
call and returns the resulting color.boolean
getModal()
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 Type
getType()
Get the GType of the ColorDialog classboolean
Returns whether colors may have alpha.void
setModal
(boolean modal) Sets whether the color chooser dialog blocks interaction with the parent window while it is presented.void
Sets the title that will be shown on the color chooser dialog.void
setWithAlpha
(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, 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, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.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 newGtkColorDialog
object.
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, 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 @Nullable Window parent, @Nullable @Nullable RGBA initialColor, @Nullable @Nullable Cancellable cancellable, @Nullable @Nullable AsyncReadyCallback callback) This function initiates a color choice operation by presenting a color chooser dialog to the user.- Parameters:
parent
- the parentGtkWindow
initialColor
- the color to select initiallycancellable
- aGCancellable
to cancel the operationcallback
- a callback to call when the operation is complete
-
chooseRgbaFinish
Finishes thechooseRgba(org.gnome.gtk.Window, org.gnome.gdk.RGBA, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)
call and returns the resulting color.- Parameters:
result
- aGAsyncResult
- Returns:
- the selected color, or
NULL
anderror
is set - Throws:
GErrorException
- seeGError
-
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
-
getTitle
Returns the title that will be shown on the color chooser dialog.- Returns:
- the title
-
getWithAlpha
public boolean getWithAlpha()Returns whether colors may have alpha.- Returns:
TRUE
if colors may have alpha
-
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
-
setTitle
Sets the title that will be shown on the color chooser dialog.- Parameters:
title
- the new title
-
setWithAlpha
public void setWithAlpha(boolean withAlpha) Sets whether colors may have alpha.- Parameters:
withAlpha
- the new value
-
builder
AColorDialog.Builder
object constructs aColorDialog
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withColorDialog.Builder.build()
.
-