WebKit2.ColorChooserRequest

g GObject.Object GObject.Object WebKit2.ColorChooserRequest WebKit2.ColorChooserRequest GObject.Object->WebKit2.ColorChooserRequest

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

cancel ()

finish ()

get_element_rectangle ()

get_rgba ()

set_rgba (rgba)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

rgba

Gdk.RGBA

r/w/c

Signals

Inherited:

GObject.Object (1)

Name

Short Description

finished

Emitted when the request finishes.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class WebKit2.ColorChooserRequest(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

WebKit2.ColorChooserRequestClass

A request to open a color chooser.

Whenever the user interacts with an HTML element, WebKit will need to show a dialog to choose a color. For that to happen in a general way, instead of just opening a Gtk.ColorChooser (which might be not desirable in some cases, which could prefer to use their own color chooser dialog), WebKit will fire the WebKit2.WebView ::run-color-chooser signal with a WebKit2.ColorChooserRequest object, which will allow the client application to specify the color to be selected, to inspect the details of the request (e.g. to get initial color) and to cancel the request, in case nothing was selected.

In case the client application does not wish to handle this signal, WebKit will provide a default handler which will asynchronously run a regular Gtk.ColorChooserDialog for the user to interact with.

cancel()

Cancels self and the input element changes to use the initial color.

Cancels self and the input element changes to use the initial color it has before the request started. The signal WebKit2.ColorChooserRequest ::finished is emitted to notify that the request has finished.

New in version 2.8.

finish()

Finishes self and the input element keeps the current value of WebKit2.ColorChooserRequest :rgba.

Finishes self and the input element keeps the current value of WebKit2.ColorChooserRequest :rgba. The signal WebKit2.ColorChooserRequest ::finished is emitted to notify that the request has finished.

New in version 2.8.

get_element_rectangle()
Returns:

a Gdk.Rectangle to fill in with the element area

Return type:

rect: Gdk.Rectangle

Gets the bounding box of the color input element.

New in version 2.8.

get_rgba()
Returns:

a Gdk.RGBA to fill in with the current color.

Return type:

rgba: Gdk.RGBA

Gets the current Gdk.RGBA color of self

New in version 2.8.

set_rgba(rgba)
Parameters:

rgba (Gdk.RGBA) – a pointer Gdk.RGBA

Sets the current Gdk.RGBA color of self

New in version 2.8.

Signal Details

WebKit2.ColorChooserRequest.signals.finished(color_chooser_request)
Signal Name:

finished

Flags:

RUN_LAST

Parameters:

color_chooser_request (WebKit2.ColorChooserRequest) – The object which received the signal

Emitted when the request finishes. This signal can be emitted because the user completed the request calling WebKit2.ColorChooserRequest.finish(), or cancelled it with WebKit2.ColorChooserRequest.cancel() or because the color input element is removed from the DOM.

New in version 2.8.

Property Details

WebKit2.ColorChooserRequest.props.rgba
Name:

rgba

Type:

Gdk.RGBA

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT

The Gdk.RGBA color of the request

New in version 2.8.