Gnome::Gtk4::PrintUnixDialog
Table of Contents
Description§
Gnome::Gtk4::PrintUnixDialog implements a print dialog for platforms which donāt provide a native print dialog, like Unix.
UNKNOWN image§
=for image :class<inline> :src<asset_files/images/printdialog.png> :width<30\%>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 Gnome::Gtk4::PrintOperation.
In order to print something with Gnome::Gtk4::PrintUnixDialog, you need to use .get-selected-printer() to obtain a Gnome::Gtk4::Printer object and use it to construct a Gnome::Gtk4::PrintJob using .newprintunixdialog() in class PrintJob.
Gnome::Gtk4::PrintUnixDialog uses the following response values:
- GTK_RESPONSE_OK: for the āPrintā button
- GTK_RESPONSE_APPLY: for the āPreviewā button
- GTK_RESPONSE_CANCEL: for the āCancelā button
GtkPrintUnixDialog as GtkBuildable§
The Gnome::Gtk4::PrintUnixDialog implementation of the Gnome::Gtk4::R-Buildable interface exposes its $notebook internal children with the name ānotebookā.
An example of a Gnome::Gtk4::PrintUnixDialog UI definition fragment:
CSS nodes§
Gnome::Gtk4::PrintUnixDialog has a single CSS node with name window. The style classes dialog and print are added.
Uml Diagram§
UNKNOWN image§
=for image :class<inline> :src<asset_files/images/plantuml/PrintUnixDialog.png> :width<70\%>Class initialization§
new§
:native-object§
Create an object using a native object from an object of the same type found elsewhere. See also Gnome::N::TopLevelSupportClass.
multi method new ( N-Object() :$native-object! )
new-printunixdialog§
Creates a new Gnome::Gtk4::PrintUnixDialog.
method new-printunixdialog ( Str $title, N-Object() $parent --> Gnome::Gtk4::PrintUnixDialog )
- $title; Title of the dialog.
- $parent; Transient parent of the dialog.
Methods§
add-custom-tab§
Adds a custom tab to the print dialog.
method add-custom-tab ( N-Object() $child, N-Object() $tab-label )
- $child; the widget to put in the custom tab.
- $tab-label; the widget to use as tab label.
get-current-page§
Gets the current page of the Gnome::Gtk4::PrintUnixDialog.
method get-current-page (--> Int )
Return value; the current page of $dialog.
get-embed-page-setup§
Gets whether to embed the page setup.
method get-embed-page-setup (--> Bool )
Return value; whether to embed the page setup.
get-has-selection§
Gets whether there is a selection.
method get-has-selection (--> Bool )
Return value; whether there is a selection.
get-manual-capabilities This function is not yet available§
Gets the capabilities that have been set on this Gnome::Gtk4::PrintUnixDialog.
method get-manual-capabilities (--> UInt )
Return value; the printing capabilities.
get-page-setup§
Gets the page setup that is used by the Gnome::Gtk4::PrintUnixDialog.
method get-page-setup (--> N-Object )
Return value; the page setup of $dialog..
get-page-setup-set§
Gets whether a page setup was set by the user.
method get-page-setup-set (--> Bool )
Return value; whether a page setup was set by user..
get-selected-printer§
Gets the currently selected printer.
method get-selected-printer (--> N-Object )
Return value; the currently selected printer.
get-settings§
Gets a new Gnome::Gtk4::PrintSettings 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.
method get-settings (--> N-Object )
Return value; a new Gnome::Gtk4::PrintSettings object with the values from $dialog.
get-support-selection§
Gets whether the print dialog allows user to print a selection.
method get-support-selection (--> Bool )
Return value; whether the application supports print of selection.
set-current-page§
Sets the current page number.
If $current-page is not -1, this enables the current page choice for the range of pages to print.
method set-current-page ( Int() $current-page )
- $current-page; the current page number..
set-embed-page-setup§
Embed page size combo box and orientation combo box into page setup page.
method set-embed-page-setup ( Bool() $embed )
- $embed; embed page setup selection.
set-has-selection§
Sets whether a selection exists.
method set-has-selection ( Bool() $has-selection )
- $has-selection; True indicates that a selection exists.
set-manual-capabilities§
This lets you specify the printing capabilities your application supports.
For instance, if you can handle scaling the output then you pass GTK_PRINT_CAPABILITY_SCALE. If you donāt pass that, then the dialog will only let you select the scale if the printing system automatically handles scaling.
method set-manual-capabilities ( UInt $capabilities )
- $capabilities; the printing capabilities of your application.
set-page-setup§
Sets the page setup of the Gnome::Gtk4::PrintUnixDialog.
method set-page-setup ( N-Object() $page-setup )
- $page-setup; a Gnome::Gtk4::PageSetup.
set-settings§
Sets the Gnome::Gtk4::PrintSettings for the Gnome::Gtk4::PrintUnixDialog.
Typically, this is used to restore saved print settings from a previous print operation before the print dialog is shown.
method set-settings ( N-Object() $settings )
- $settings; a Gnome::Gtk4::PrintSettings.
set-support-selection§
Sets whether the print dialog allows user to print a selection.
method set-support-selection ( Bool() $support-selection )
- $support-selection; True to allow print selection.
About my projects, examples and tutorials