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

The ::got-page-size signal is 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

end_preview()[source]

Ends a preview.

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

New in version 2.10.

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.

New in version 2.10.

render_page(page_nr)[source]
Parameters:

page_nr (int) – the page to render

Renders a page to the preview, using the print context that was passed to the Gtk.PrintOperation ::preview handler together with self.

A custom iprint preview should use this function in its ::expose handler to render the currently selected page.

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

New in version 2.10.

do_end_preview() virtual

Ends a preview.

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

New in version 2.10.

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.

New in version 2.10.

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, using the print context that was passed to the Gtk.PrintOperation ::preview handler together with preview.

A custom iprint preview should use this function in its ::expose handler to render the currently selected page.

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

New in version 2.10.

Signal Details

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

got-page-size

Flags:

RUN_LAST

Parameters:

The ::got-page-size signal is 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 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.