Skip to content

Gtk.PageSetupUnixDialog

class — extends Dialog, Accessible, Buildable, ConstraintTarget, Native, Root, ShortcutManager

Presents a page setup dialog for platforms which don’t provide a native page setup dialog, like Unix.

<picture> <source srcset="pagesetupdialog-dark.png" media="(prefers-color-scheme: dark)"> <img alt="An example GtkPageSetupUnixDialog" src="pagesetupdialog.png"> </picture>

It can be used very much like any other GTK dialog, at the cost of the portability offered by the high-level printing API in PrintOperation.

CSS nodes

GtkPageSetupUnixDialog has a single CSS node with the name window and style class .pagesetup.

Constructors

new

@classmethod
def new(cls, title: str | None = ..., parent: Window | None = ...) -> Widget

Creates a new page setup dialog.

Parameters:

  • title — the title of the dialog
  • parent — transient parent of the dialog

Methods

get_page_setup

def get_page_setup(self) -> PageSetup

Gets the currently selected page setup from the dialog.

get_print_settings

def get_print_settings(self) -> PrintSettings | None

Gets the current print settings from the dialog.

set_page_setup

def set_page_setup(self, page_setup: PageSetup) -> None

Sets the GtkPageSetup from which the page setup dialog takes its values.

Parameters:

  • page_setup — a GtkPageSetup

set_print_settings

def set_print_settings(self, print_settings: PrintSettings | None = ...) -> None

Sets the GtkPrintSettings from which the page setup dialog takes its values.

Parameters:

  • print_settings — a GtkPrintSettings