Gtk.PrintOperationPreview

g GObject.GInterface GObject.GInterface Gtk.PrintOperationPreview Gtk.PrintOperationPreview GObject.GInterface->Gtk.PrintOperationPreview

Implementations:

Gtk.PrintOperation

Methods

end_preview ()

is_selected (page_nr)

render_page (page_nr)

Virtual Methods

do_end_preview ()

do_got_page_size (context, page_setup)

do_is_selected (page_nr)

do_ready (context)

do_render_page (page_nr)

Properties

None

Signals

Name

Short Description

got-page-size

Emitted once for each page that gets rendered to the preview.

ready

The ::ready signal gets emitted once per preview operation, before the first page is rendered.

Fields

None

Class Details

class Gtk.PrintOperationPreview
Bases:

GObject.GInterface

Structure:

Gtk.PrintOperationPreviewIface

GtkPrintOperationPreview is the interface that is used to implement print preview.

A GtkPrintOperationPreview object is passed to the [signal`Gtk`.PrintOperation::preview] signal by [class`Gtk`.PrintOperation].

end_preview()[source]

Ends a preview.

This function must be called to finish a custom print preview.

is_selected(page_nr)[source]
Parameters:

page_nr (int) – a page number

Returns:

True if the page has been selected for printing

Return type:

bool

Returns whether the given page is included in the set of pages that have been selected for printing.

render_page(page_nr)[source]
Parameters:

page_nr (int) – the page to render

Renders a page to the preview.

This is using the print context that was passed to the [signal`Gtk`.PrintOperation::preview] handler together with self.

A custom print preview should use this function to render the currently selected page.

Note that this function requires a suitable cairo context to be associated with the print context.

do_end_preview() virtual

Ends a preview.

This function must be called to finish a custom print preview.

do_got_page_size(context, page_setup) virtual
Parameters:
do_is_selected(page_nr) virtual
Parameters:

page_nr (int) – a page number

Returns:

True if the page has been selected for printing

Return type:

bool

Returns whether the given page is included in the set of pages that have been selected for printing.

do_ready(context) virtual
Parameters:

context (Gtk.PrintContext) –

do_render_page(page_nr) virtual
Parameters:

page_nr (int) – the page to render

Renders a page to the preview.

This is using the print context that was passed to the [signal`Gtk`.PrintOperation::preview] handler together with preview.

A custom print preview should use this function to render the currently selected page.

Note that this function requires a suitable cairo context to be associated with the print context.

Signal Details

Gtk.PrintOperationPreview.signals.got_page_size(print_operation_preview, context, page_setup)
Signal Name:

got-page-size

Flags:

RUN_LAST

Parameters:

Emitted once for each page that gets rendered to the preview.

A handler for this signal should update the context according to page_setup and set up a suitable cairo context, using [method`Gtk`.PrintContext.set_cairo_context].

Gtk.PrintOperationPreview.signals.ready(print_operation_preview, context)
Signal Name:

ready

Flags:

RUN_LAST

Parameters:

The ::ready signal gets emitted once per preview operation, before the first page is rendered.

A handler for this signal can be used for setup tasks.