Gtk.PrintUnixDialog¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Dialog (11), Gtk.Window (62), Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1), Gtk.Native (6), Gtk.Root (3)
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
Properties¶
- Inherited:
Gtk.Dialog (1), Gtk.Window (25), Gtk.Widget (34), 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
GtkPrintUnixDialog
implements a print dialog for platforms which don’t provide a native print dialog, like Unix.An example
Gtk.PrintUnixDialog
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].GtkPrintUnixDialog
uses the following response values:Gtk.ResponseType.OK
: for the “Print” buttonGtk.ResponseType.APPLY
: for the “Preview” buttonGtk.ResponseType.CANCEL
: for the “Cancel” button
The
GtkPrintUnixDialog
implementation of theGtkBuildable
interface exposes its notebook internal children with the name “notebook”.An example of a
GtkPrintUnixDialog
UI definition fragment:```xml
<child>
False False
Tab label </object>
Content on notebook tab /object
/object /child /object /child /object ```
- CSS nodes
GtkPrintUnixDialog
has a single CSS node with name window. The style classes dialog and print are added.- classmethod new(title, parent)[source]¶
- Parameters:
parent (
Gtk.Window
orNone
) – 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.Printer
orNone
Gets the currently selected printer.
- get_settings()[source]¶
- Returns:
a new
GtkPrintSettings
object with the values from self- Return type:
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.
- 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.PrintSettings
orNone
) – aGtkPrintSettings
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.
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
GtkPageSetup
object to use.
- Gtk.PrintUnixDialog.props.print_settings¶
- Name:
print-settings
- Type:
- Default Value:
- Flags:
The
GtkPrintSettings
object used for this dialog.
- Gtk.PrintUnixDialog.props.selected_printer¶
- Name:
selected-printer
- Type:
- Default Value:
- Flags:
The
GtkPrinter
which is selected.