Gtk.PrintUnixDialog¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Dialog (11), Gtk.Window (62), Gtk.Widget (183), GObject.Object (37), Gtk.Accessible (17), Gtk.Buildable (1), Gtk.Native (6), Gtk.Root (3)
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
Properties¶
- Inherited:
Gtk.Dialog (1), Gtk.Window (25), Gtk.Widget (35), Gtk.Accessible (1)
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r |
|||
r/w |
Signals¶
- Inherited:
Gtk.Dialog (2), Gtk.Window (5), Gtk.Widget (13), GObject.Object (1)
Fields¶
- Inherited:
Gtk.Dialog (2), Gtk.Window (5), Gtk.Widget (13), GObject.Object (1)
Class Details¶
- class Gtk.PrintUnixDialog(*args, **kwargs)¶
- Bases:
- Abstract:
No
A print dialog for platforms which don’t provide a native print dialog, like Unix.
<picture> <source srcset=”printdialog-dark.png” media=”(prefers-color-scheme: dark)”> <img alt=”An example
Gtk.PrintUnixDialog" src=”printdialog.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 with [class`Gtk`.PrintOperation].
In order to print something with
GtkPrintUnixDialog, you need to use [method`Gtk`.PrintUnixDialog.get_selected_printer] to obtain a [class`Gtk`.Printer] object and use it to construct a [class`Gtk`.PrintJob] using [ctor`Gtk`.PrintJob.new].GtkPrintUnixDialoguses the following response values:Gtk.ResponseType.OK: for the “Print” buttonGtk.ResponseType.APPLY: for the “Preview” buttonGtk.ResponseType.CANCEL: for the “Cancel” button
The
GtkPrintUnixDialogimplementation of theGtkBuildableinterface exposes its notebook internal children with the name “notebook”.An example of a
GtkPrintUnixDialogUI definition fragment:``xml <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
GtkPrintUnixDialoghas a single CSS node with name window. The style classes dialog and print are added.- classmethod new(title, parent)[source]¶
- Parameters:
parent (
Gtk.WindoworNone) – Transient parent of the dialog
- Returns:
a new
GtkPrintUnixDialog- Return type:
Creates a new
GtkPrintUnixDialog.
- add_custom_tab(child, tab_label)[source]¶
- Parameters:
child (
Gtk.Widget) – the widget to put in the custom tabtab_label (
Gtk.Widget) – the widget to use as tab label
Adds a custom tab to the print dialog.
- get_current_page()[source]¶
- Returns:
the current page of self
- Return type:
Gets the current page of the
GtkPrintUnixDialog.
- get_embed_page_setup()[source]¶
- Returns:
whether to embed the page setup
- Return type:
Gets whether to embed the page setup.
- get_has_selection()[source]¶
- Returns:
whether there is a selection
- Return type:
Gets whether there is a selection.
- get_manual_capabilities()[source]¶
- Returns:
the printing capabilities
- Return type:
Gets the capabilities that have been set on this
GtkPrintUnixDialog.
- get_page_setup()[source]¶
- Returns:
the page setup of self.
- Return type:
Gets the page setup that is used by the
GtkPrintUnixDialog.
- get_page_setup_set()[source]¶
- Returns:
whether a page setup was set by user.
- Return type:
Gets whether a page setup was set by the user.
- get_selected_printer()[source]¶
- Returns:
the currently selected printer
- Return type:
Gtk.PrinterorNone
Gets the currently selected printer.
- get_settings()[source]¶
- Returns:
a new
GtkPrintSettingsobject with the values from self- Return type:
Gets a new
GtkPrintSettingsobject 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.
- get_support_selection()[source]¶
- Returns:
whether the application supports print of selection
- Return type:
Gets whether the print dialog allows user to print a selection.
- set_current_page(current_page)[source]¶
- Parameters:
current_page (
int) – the current page number.
Sets the current page number.
If current_page is not -1, this enables the current page choice for the range of pages to print.
- set_embed_page_setup(embed)[source]¶
- Parameters:
embed (
bool) – embed page setup selection
Embed page size combo box and orientation combo box into page setup page.
- set_manual_capabilities(capabilities)[source]¶
- Parameters:
capabilities (
Gtk.PrintCapabilities) – the printing capabilities of your application
This lets you specify the printing capabilities your application supports.
For instance, if you can handle scaling the output then you pass
Gtk.PrintCapabilities.SCALE. If you don’t pass that, then the dialog will only let you select the scale if the printing system automatically handles scaling.
- set_page_setup(page_setup)[source]¶
- Parameters:
page_setup (
Gtk.PageSetup) – aGtkPageSetup
Sets the page setup of the
GtkPrintUnixDialog.
- set_settings(settings)[source]¶
- Parameters:
settings (
Gtk.PrintSettingsorNone) – aGtkPrintSettings
Sets the
GtkPrintSettingsfor theGtkPrintUnixDialog.Typically, this is used to restore saved print settings from a previous print operation before the print dialog is shown.
Property Details¶
- Gtk.PrintUnixDialog.props.current_page¶
-
The current page in the document.
- Gtk.PrintUnixDialog.props.has_selection¶
-
Whether the application has a selection.
- Gtk.PrintUnixDialog.props.manual_capabilities¶
- Name:
manual-capabilities- Type:
- Default Value:
0- Flags:
Capabilities the application can handle.
- Gtk.PrintUnixDialog.props.page_setup¶
- Name:
page-setup- Type:
- Default Value:
- Flags:
The
GtkPageSetupobject to use.
- Gtk.PrintUnixDialog.props.print_settings¶
- Name:
print-settings- Type:
- Default Value:
- Flags:
The
GtkPrintSettingsobject used for this dialog.
- Gtk.PrintUnixDialog.props.selected_printer¶
- Name:
selected-printer- Type:
- Default Value:
- Flags:
The
GtkPrinterwhich is selected.