PrintUnixDialogProtocol
public protocol PrintUnixDialogProtocol : DialogProtocol
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
[classGtk.PrintOperation].
In order to print something with GtkPrintUnixDialog, you need to
use [methodGtk.PrintUnixDialog.get_selected_printer] to obtain a
[classGtk.Printer] object and use it to construct a [classGtk.PrintJob]
using [ctorGtk.PrintJob.new].
GtkPrintUnixDialog uses the following response values:
GTK_RESPONSE_OK:for the “Print” buttonGTK_RESPONSE_APPLY:for the “Preview” buttonGTK_RESPONSE_CANCEL:for the “Cancel” button
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.
The PrintUnixDialogProtocol protocol exposes the methods and properties of an underlying GtkPrintUnixDialog instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see PrintUnixDialog.
Alternatively, use PrintUnixDialogRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkPrintUnixDialoginstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
print_unix_dialog_ptrDefault implementationTyped pointer to the underlying
GtkPrintUnixDialoginstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkPrintUnixDialoginstance.Declaration
Swift
var print_unix_dialog_ptr: UnsafeMutablePointer<GtkPrintUnixDialog>! { get } -
Required Initialiser for types conforming to
PrintUnixDialogProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
PrintUnixDialogPropertyNamesource property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: PrintUnixDialogPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocolParameters
source_propertythe source property to bind
targetthe target object to bind to
target_propertythe target property to bind to
flagsthe flags to pass to the
Bindingtransform_fromValueTransformerto use for forward transformationtransform_toValueTransformerto use for backwards transformationReturn Value
binding reference or
nilin case of an error -
get(property:Extension method) Get the value of a PrintUnixDialog property
Declaration
Swift
@inlinable func get(property: PrintUnixDialogPropertyName) -> GLibObject.ValueParameters
propertythe property to get the value for
Return Value
the value of the named property
-
set(property:Extension methodvalue: ) Set the value of a PrintUnixDialog property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: PrintUnixDialogPropertyName, value v: GLibObject.Value)Parameters
propertythe property to get the value for
Return Value
the value of the named property
-
addCustomTab(child:Extension methodtabLabel: ) Adds a custom tab to the print dialog.
Declaration
Swift
@inlinable func addCustomTab<WidgetT>(child: WidgetT, tabLabel: WidgetT) where WidgetT : WidgetProtocol -
getCurrentPage()Extension methodGets the current page of the
GtkPrintUnixDialog.Declaration
Swift
@inlinable func getCurrentPage() -> Int -
getEmbedPageSetup()Extension methodGets whether to embed the page setup.
Declaration
Swift
@inlinable func getEmbedPageSetup() -> Bool -
getHasSelection()Extension methodGets whether there is a selection.
Declaration
Swift
@inlinable func getHasSelection() -> Bool -
getManualCapabilities()Extension methodGets the capabilities that have been set on this
GtkPrintUnixDialog.Declaration
Swift
@inlinable func getManualCapabilities() -> PrintCapabilities -
getPageSetup()Extension methodGets the page setup that is used by the
GtkPrintUnixDialog.Declaration
Swift
@inlinable func getPageSetup() -> PageSetupRef! -
getPageSetupSet()Extension methodGets whether a page setup was set by the user.
Declaration
Swift
@inlinable func getPageSetupSet() -> Bool -
getSelectedPrinter()Extension methodGets the currently selected printer.
Declaration
Swift
@inlinable func getSelectedPrinter() -> PrinterRef! -
getSettings()Extension methodGets 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.
Declaration
Swift
@inlinable func getSettings() -> PrintSettingsRef! -
getSupportSelection()Extension methodGets whether the print dialog allows user to print a selection.
Declaration
Swift
@inlinable func getSupportSelection() -> Bool -
set(currentPage:Extension method) Sets the current page number.
If
current_pageis not -1, this enables the current page choice for the range of pages to print.Declaration
Swift
@inlinable func set(currentPage: Int) -
setEmbedPageSetup(embed:Extension method) Embed page size combo box and orientation combo box into page setup page.
Declaration
Swift
@inlinable func setEmbedPageSetup(embed: Bool) -
set(hasSelection:Extension method) Sets whether a selection exists.
Declaration
Swift
@inlinable func set(hasSelection: Bool) -
setManual(capabilities:Extension method) 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.Declaration
Swift
@inlinable func setManual(capabilities: PrintCapabilities) -
set(pageSetup:Extension method) Sets the page setup of the
GtkPrintUnixDialog.Declaration
Swift
@inlinable func set<PageSetupT>(pageSetup: PageSetupT) where PageSetupT : PageSetupProtocol -
set(settings:Extension method) Sets the
GtkPrintSettingsfor theGtkPrintUnixDialog.Typically, this is used to restore saved print settings from a previous print operation before the print dialog is shown.
Declaration
Swift
@inlinable func set(settings: PrintSettingsRef? = nil) -
set(settings:Extension method) Sets the
GtkPrintSettingsfor theGtkPrintUnixDialog.Typically, this is used to restore saved print settings from a previous print operation before the print dialog is shown.
Declaration
Swift
@inlinable func set<PrintSettingsT>(settings: PrintSettingsT?) where PrintSettingsT : PrintSettingsProtocol -
set(supportSelection:Extension method) Sets whether the print dialog allows user to print a selection.
Declaration
Swift
@inlinable func set(supportSelection: Bool) -
currentPageExtension methodGets the current page of the
GtkPrintUnixDialog.Declaration
Swift
@inlinable var currentPage: Int { get nonmutating set } -
embedPageSetupExtension methodGets whether to embed the page setup.
Declaration
Swift
@inlinable var embedPageSetup: Bool { get nonmutating set } -
hasSelectionExtension methodGets whether there is a selection.
Declaration
Swift
@inlinable var hasSelection: Bool { get nonmutating set } -
manualCapabilitiesExtension methodGets the capabilities that have been set on this
GtkPrintUnixDialog.Declaration
Swift
@inlinable var manualCapabilities: PrintCapabilities { get nonmutating set } -
pageSetupExtension methodGets the page setup that is used by the
GtkPrintUnixDialog.Declaration
Swift
@inlinable var pageSetup: PageSetupRef! { get nonmutating set } -
pageSetupSetExtension methodGets whether a page setup was set by the user.
Declaration
Swift
@inlinable var pageSetupSet: Bool { get } -
selectedPrinterExtension methodGets the currently selected printer.
Declaration
Swift
@inlinable var selectedPrinter: PrinterRef! { get } -
settingsExtension methodGets 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.
Declaration
Swift
@inlinable var settings: PrintSettingsRef! { get nonmutating set } -
supportSelectionExtension methodGets whether the print dialog allows user to print a selection.
Declaration
Swift
@inlinable var supportSelection: Bool { get nonmutating set }
View on GitHub
Install in Dash
PrintUnixDialogProtocol Protocol Reference