gtk.print_unix_dialog
Module for [PrintUnixDialog] class
Types 3
[gtk.print_unix_dialog.PrintUnixDialog] implements a print dialog for platforms which don’t provide a native print dialog, like Unix.
!An example GtkPrintUnixDialog
It can be used very much like any other GTK dialog, at the cost of the portability offered by the high-level printing API with [gtk.print_operation.PrintOperation].
In order to print something with [gtk.print_unix_dialog.PrintUnixDialog], you need to use [gtk.print_unix_dialog.PrintUnixDialog.getSelectedPrinter] to obtain a [gtk.printer.Printer] object and use it to construct a [gtk.print_job.PrintJob] using [gtk.print_job.PrintJob.new_].
[gtk.print_unix_dialog.PrintUnixDialog] uses the following response values:
- [gtk.types.ResponseType.Ok]: for the “Print” button
- [gtk.types.ResponseType.Apply]: for the “Preview” button
- [gtk.types.ResponseType.Cancel]: for the “Cancel” button
GtkPrintUnixDialog as GtkBuildable
The [gtk.print_unix_dialog.PrintUnixDialog] implementation of the [gtk.buildable.Buildable] interface exposes its @notebook internal children with the name “notebook”.
An example of a [gtk.print_unix_dialog.PrintUnixDialog] UI definition fragment:
<object class="GtkPrintUnixDialog" id="dialog1">
<child internal-child="notebook">
<object class="GtkNotebook" id="notebook">
<child>
<object type="GtkNotebookPage">
<property name="tab_expand">False</property>
<property name="tab_fill">False</property>
<property name="tab">
<object class="GtkLabel" id="tablabel">
<property name="label">Tab label</property>
</object>
</property>
<property name="child">
<object class="GtkLabel" id="tabcontent">
<property name="label">Content on notebook tab</property>
</object>
</property>
</object>
</child>
</object>
</child>
</object>CSS nodes
[gtk.print_unix_dialog.PrintUnixDialog] has a single CSS node with name window. The style classes dialog and print are added.
PrintUnixDialog self()Returns `this`, for use in `with` statements.PrintUnixDialogGidBuilder builder()Get builder for [gtk.printunixdialog.PrintUnixDialog] Returns: New builder objectvoid currentPage(int propval) @propertySet `currentPage` property. Params: propval = The current page in the document.bool embedPageSetup() @propertyGet `embedPageSetup` property. Returns: true if the page setup controls are embedded.void embedPageSetup(bool propval) @propertySet `embedPageSetup` property. Params: propval = true if the page setup controls are embedded.bool hasSelection() @propertyGet `hasSelection` property. Returns: Whether the application has a selection.void hasSelection(bool propval) @propertySet `hasSelection` property. Params: propval = Whether the application has a selection.gtk.types.PrintCapabilities manualCapabilities() @propertyGet `manualCapabilities` property. Returns: Capabilities the application can handle.void manualCapabilities(gtk.types.PrintCapabilities propval) @propertySet `manualCapabilities` property. Params: propval = Capabilities the application can handle.gtk.page_setup.PageSetup pageSetup() @propertyGet `pageSetup` property. Returns: The [gtk.page_setup.PageSetup] object to use.void pageSetup(gtk.page_setup.PageSetup propval) @propertySet `pageSetup` property. Params: propval = The [gtk.page_setup.PageSetup] object to use.gtk.print_settings.PrintSettings printSettings() @propertyGet `printSettings` property. Returns: The [gtk.print_settings.PrintSettings] object used for this dialog.void printSettings(gtk.print_settings.PrintSettings propval) @propertySet `printSettings` property. Params: propval = The [gtk.print_settings.PrintSettings] object used for this dialog.gtk.printer.Printer selectedPrinter() @propertyGet `selectedPrinter` property. Returns: The [gtk.printer.Printer] which is selected.bool supportSelection() @propertyGet `supportSelection` property. Returns: Whether the dialog supports selection.void supportSelection(bool propval) @propertySet `supportSelection` property. Params: propval = Whether the dialog supports selection.void addCustomTab(gtk.widget.Widget child, gtk.widget.Widget tabLabel)Adds a custom tab to the print dialog.int getCurrentPage()Gets the current page of the [gtk.printunixdialog.PrintUnixDialog]. Returns: the current page of dialogbool getEmbedPageSetup()Gets whether to embed the page setup. Returns: whether to embed the page setupbool getHasSelection()Gets whether there is a selection. Returns: whether there is a selectiongtk.types.PrintCapabilities getManualCapabilities()Gets the capabilities that have been set on this [gtk.printunixdialog.PrintUnixDialog]. Returns: the printing capabilitiesgtk.page_setup.PageSetup getPageSetup()Gets the page setup that is used by the [gtk.printunixdialog.PrintUnixDialog]. Returns: the page setup of dialog.bool getPageSetupSet()Gets whether a page setup was set by the user. Returns: whether a page setup was set by user.gtk.printer.Printer getSelectedPrinter()Gets the currently selected printer. Returns: the currently selected printergtk.print_settings.PrintSettings getSettings()Gets a new [gtk.print_settings.PrintSettings] object that represents the current values in the print dialog.bool getSupportSelection()Gets whether the print dialog allows user to print a selection. Returns: whether the application supports print of selectionvoid setCurrentPage(int currentPage)Sets the current page number.void setEmbedPageSetup(bool embed)Embed page size combo box and orientation combo box into page setup page.void setHasSelection(bool hasSelection)Sets whether a selection exists.void setManualCapabilities(gtk.types.PrintCapabilities capabilities)This lets you specify the printing capabilities your application supports.void setPageSetup(gtk.page_setup.PageSetup pageSetup)Sets the page setup of the [gtk.printunixdialog.PrintUnixDialog].void setSettings(gtk.print_settings.PrintSettings settings = null)Sets the [gtk.printsettings.PrintSettings] for the [gtk.printunix_dialog.PrintUnixDialog].void setSupportSelection(bool supportSelection)Sets whether the print dialog allows user to print a selection.this(string title = null, gtk.window.Window parent = null)Creates a new [gtk.printunixdialog.PrintUnixDialog].T currentPage(int propval)Set `currentPage` property. Params: propval = The current page in the document. Returns: Builder instance for fluent chainingT embedPageSetup(bool propval)Set `embedPageSetup` property. Params: propval = true if the page setup controls are embedded. Returns: Builder instance for fluent chainingT hasSelection(bool propval)Set `hasSelection` property. Params: propval = Whether the application has a selection. Returns: Builder instance for fluent chainingT manualCapabilities(gtk.types.PrintCapabilities propval)Set `manualCapabilities` property. Params: propval = Capabilities the application can handle. Returns: Builder instance for fluent chainingT pageSetup(gtk.page_setup.PageSetup propval)Set `pageSetup` property. Params: propval = The [gtk.page_setup.PageSetup] object to use. Returns: Builder instance for fluent chainingT printSettings(gtk.print_settings.PrintSettings propval)Set `printSettings` property. Params: propval = The [gtk.print_settings.PrintSettings] object used for this dialog. Returns: Builder instance for fluent chainingT supportSelection(bool propval)Set `supportSelection` property. Params: propval = Whether the dialog supports selection. Returns: Builder instance for fluent chainingFluent builder for [gtk.print_unix_dialog.PrintUnixDialog]