PrintUnixDialog#
- class PrintUnixDialog(*args, **kwargs)#
Superclasses: Dialog
, Window
, Widget
, InitiallyUnowned
, Object
Implemented Interfaces: Accessible
, Buildable
, ConstraintTarget
, Native
, Root
, ShortcutManager
GtkPrintUnixDialog
implements a print dialog for platforms
which don’t provide a native print dialog, like Unix.
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
PrintOperation
.
In order to print something with GtkPrintUnixDialog
, you need to
use get_selected_printer
to obtain a
Printer
object and use it to construct a PrintJob
using new
.
GtkPrintUnixDialog
uses the following response values:
GtkPrintUnixDialog as GtkBuildable#
The GtkPrintUnixDialog
implementation of the GtkBuildable
interface
exposes its notebook
internal children with the name “notebook”.
An example of a GtkPrintUnixDialog
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#
GtkPrintUnixDialog
has a single CSS node with name window. The style classes
dialog and print are added.
Constructors#
Methods#
- class PrintUnixDialog
- add_custom_tab(child: Widget, tab_label: Widget) None #
Adds a custom tab to the print dialog.
- Parameters:
child – the widget to put in the custom tab
tab_label – the widget to use as tab label
- get_manual_capabilities() PrintCapabilities #
Gets the capabilities that have been set on this
GtkPrintUnixDialog
.
- get_settings() PrintSettings #
Gets a new
GtkPrintSettings
object that represents the current values in the print dialog.Note that this creates a new object, and you need to unref it if don’t want to keep it.
- set_current_page(current_page: int) None #
Sets the current page number.
If
current_page
is not -1, this enables the current page choice for the range of pages to print.- Parameters:
current_page – the current page number.
- set_embed_page_setup(embed: bool) None #
Embed page size combo box and orientation combo box into page setup page.
- Parameters:
embed – embed page setup selection
- set_has_selection(has_selection: bool) None #
Sets whether a selection exists.
- Parameters:
has_selection –
True
indicates that a selection exists
- set_manual_capabilities(capabilities: PrintCapabilities) None #
This lets you specify the printing capabilities your application supports.
For instance, if you can handle scaling the output then you pass
SCALE
. If you don’t pass that, then the dialog will only let you select the scale if the printing system automatically handles scaling.- Parameters:
capabilities – the printing capabilities of your application
- set_page_setup(page_setup: PageSetup) None #
Sets the page setup of the
GtkPrintUnixDialog
.- Parameters:
page_setup – a
GtkPageSetup
- set_settings(settings: PrintSettings | None = None) None #
Sets the
GtkPrintSettings
for theGtkPrintUnixDialog
.Typically, this is used to restore saved print settings from a previous print operation before the print dialog is shown.
- Parameters:
settings – a
GtkPrintSettings
Properties#
- class PrintUnixDialog
-
- props.manual_capabilities: PrintCapabilities#
The type of the None singleton.
- props.print_settings: PrintSettings#
The type of the None singleton.