WebKit2.PrintCustomWidget

g GObject.Object GObject.Object WebKit2.PrintCustomWidget WebKit2.PrintCustomWidget GObject.Object->WebKit2.PrintCustomWidget

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (widget, title)

get_title ()

get_widget ()

Virtual Methods

Inherited:

GObject.Object (7)

do_apply (widget)

do_update (widget, page_setup, print_settings)

Properties

Name

Type

Flags

Short Description

title

str

r/w/co

deprecated

widget

Gtk.Widget

r/w/co

deprecated

Signals

Inherited:

GObject.Object (1)

Name

Short Description

apply

Emitted right before the printing will start. deprecated

update

Emitted after change of selected printer in the dialog. deprecated

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class WebKit2.PrintCustomWidget(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

WebKit2.PrintCustomWidgetClass

Allows to embed a custom widget in print dialog.

A WebKit2.PrintCustomWidget allows to embed a custom widget in the print dialog by connecting to the WebKit2.PrintOperation ::create-custom-widget signal, creating a new WebKit2.PrintCustomWidget with WebKit2.PrintCustomWidget.new() and returning it from there. You can later use WebKit2.PrintOperation.run_dialog() to display the dialog.

Unfortunately, use of custom widgets is incompatible with modern containerized application frameworks like Flatpak. A print dialog constructed in the application process will not have access to host printers, so instead it must be constructed by a desktop portal service running on the host system. Because this print dialog runs in a separate process, it’s not possible to attach a custom widget.

New in version 2.16.

Deprecated since version 2.40.

classmethod new(widget, title)
Parameters:
Returns:

a new WebKit2.PrintOperation.

Return type:

WebKit2.PrintCustomWidget

Create a new WebKit2.PrintCustomWidget with given widget and title.

The widget ownership is taken and it is destroyed together with the dialog even if this object could still be alive at that point. You typically want to pass a container widget with multiple widgets in it.

New in version 2.16.

Deprecated since version 2.40.

get_title()
Returns:

Title of the self.

Return type:

str

Return the value of WebKit2.PrintCustomWidget :title property.

Return the value of WebKit2.PrintCustomWidget :title property for the given self object.

New in version 2.16.

Deprecated since version 2.40.

get_widget()
Returns:

a Gtk.Widget.

Return type:

Gtk.Widget

Return the value of WebKit2.PrintCustomWidget :widget property.

Return the value of WebKit2.PrintCustomWidget :widget property for the given self object. The returned value will always be valid if called from WebKit2.PrintCustomWidget ::apply or WebKit2.PrintCustomWidget ::update callbacks, but it will be None if called after the WebKit2.PrintCustomWidget ::apply signal is emitted.

New in version 2.16.

Deprecated since version 2.40.

do_apply(widget) virtual
Parameters:

widget (Gtk.Widget) –

do_update(widget, page_setup, print_settings) virtual
Parameters:

Signal Details

WebKit2.PrintCustomWidget.signals.apply(print_custom_widget)
Signal Name:

apply

Flags:

RUN_LAST

Parameters:

print_custom_widget (WebKit2.PrintCustomWidget) – The object which received the signal

Emitted right before the printing will start. You should read the information from the widget and update the content based on it if necessary. The widget is not guaranteed to be valid at a later time.

New in version 2.16.

Deprecated since version 2.40.

WebKit2.PrintCustomWidget.signals.update(print_custom_widget, page_setup, print_settings)
Signal Name:

update

Flags:

RUN_LAST

Parameters:

Emitted after change of selected printer in the dialog. The actual page setup and print settings are available and the custom widget can actualize itself according to their values.

New in version 2.16.

Deprecated since version 2.40.

Property Details

WebKit2.PrintCustomWidget.props.title
Name:

title

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The title of the custom widget.

New in version 2.16.

Deprecated since version 2.40.

WebKit2.PrintCustomWidget.props.widget
Name:

widget

Type:

Gtk.Widget

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The custom Gtk.Widget that will be embedded in the dialog.

New in version 2.16.

Deprecated since version 2.40.