1.157 <GtkPrintUnixDialog>

Class: <GtkPrintUnixDialog>

It derives from <GtkDialog>.

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 <GtkPrintOperation>.

In order to print something with <GtkPrintUnixDialog>, you need to use print-unix-dialog:get-selected-printer to obtain a <GtkPrinter> object and use it to construct a <GtkPrintJob> using print-job:new.

<GtkPrintUnixDialog> 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 <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.

Properties

Property: print-unix-dialog:current-page self

The current page in the document.

Its value is a 32-bit integer.

Set it with (set! (print-unix-dialog:current-page self) value).

Property: print-unix-dialog:embed-page-setup self

#t if the page setup controls are embedded.

Its value is a boolean.

Set it with (set! (print-unix-dialog:embed-page-setup self) value).

Property: print-unix-dialog:has-selection self

Whether the application has a selection.

Its value is a boolean.

Set it with (set! (print-unix-dialog:has-selection self) value).

Property: print-unix-dialog:manual-capabilities self

Capabilities the application can handle.

Its value is a <GtkPrintCapabilities> (or, to set it, a list of its symbols, or one of them).

Set it with (set! (print-unix-dialog:manual-capabilities self) value).

Property: print-unix-dialog:page-setup self

The <GtkPageSetup> object to use.

Its value is a <GtkPageSetup>, or #f.

Set it with (set! (print-unix-dialog:page-setup self) value).

Property: print-unix-dialog:print-settings self

The <GtkPrintSettings> object used for this dialog.

Its value is a <GtkPrintSettings>, or #f.

Set it with (set! (print-unix-dialog:print-settings self) value).

Property: print-unix-dialog:selected-printer self

The <GtkPrinter> which is selected.

Its value is a <GtkPrinter>, or #f.

It is read only.

Property: print-unix-dialog:support-selection self

Whether the dialog supports selection.

Its value is a boolean.

Set it with (set! (print-unix-dialog:support-selection self) value).

Procedures

Method: print-unix-dialog:add-custom-tab self child tab-label
Method: add-custom-tab self child tab-label

Adds a custom tab to the print dialog.

self

Passed: a <GtkPrintUnixDialog>.

a <GtkPrintUnixDialog>

child

Passed: a <GtkWidget>.

the widget to put in the custom tab

tab-label

Passed: a <GtkWidget>.

the widget to use as tab label

Method: print-unix-dialog:get-current-page self ⇒ %return
Method: get-current-page self ⇒ %return

Gets the current page of the <GtkPrintUnixDialog>.

self

Passed: a <GtkPrintUnixDialog>.

a <GtkPrintUnixDialog>

%return

Returned: a 32-bit integer.

the current page of self

Method: print-unix-dialog:get-embed-page-setup? self ⇒ %return
Method: get-embed-page-setup? self ⇒ %return

Gets whether to embed the page setup.

self

Passed: a <GtkPrintUnixDialog>.

a <GtkPrintUnixDialog>

%return

Returned: a boolean.

whether to embed the page setup

Method: print-unix-dialog:get-has-selection? self ⇒ %return
Method: get-has-selection? self ⇒ %return

Gets whether there is a selection.

self

Passed: a <GtkPrintUnixDialog>.

a <GtkPrintUnixDialog>

%return

Returned: a boolean.

whether there is a selection

Method: print-unix-dialog:get-manual-capabilities self ⇒ %return
Method: get-manual-capabilities self ⇒ %return

Gets the capabilities that have been set on this <GtkPrintUnixDialog>.

self

Passed: a <GtkPrintUnixDialog>.

a <GtkPrintUnixDialog>

%return

Returned: a <GtkPrintCapabilities>.

the printing capabilities

Method: print-unix-dialog:get-page-setup self ⇒ %return
Method: get-page-setup self ⇒ %return

Gets the page setup that is used by the <GtkPrintUnixDialog>.

self

Passed: a <GtkPrintUnixDialog>.

a <GtkPrintUnixDialog>

%return

Returned: a <GtkPageSetup>.

the page setup of self.

Method: print-unix-dialog:get-page-setup-set? self ⇒ %return
Method: get-page-setup-set? self ⇒ %return

Gets whether a page setup was set by the user.

self

Passed: a <GtkPrintUnixDialog>.

a <GtkPrintUnixDialog>

%return

Returned: a boolean.

whether a page setup was set by user.

Method: print-unix-dialog:get-selected-printer self ⇒ %return
Method: get-selected-printer self ⇒ %return

Gets the currently selected printer.

self

Passed: a <GtkPrintUnixDialog>.

a <GtkPrintUnixDialog>

%return

Returned: a <GtkPrinter>, or #f.

the currently selected printer

Method: print-unix-dialog:get-settings self ⇒ %return
Method: get-settings self ⇒ %return

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.

self

Passed: a <GtkPrintUnixDialog>.

a <GtkPrintUnixDialog>

%return

Returned: a <GtkPrintSettings>.

a new <GtkPrintSettings> object with the values from self

Method: print-unix-dialog:get-support-selection? self ⇒ %return
Method: get-support-selection? self ⇒ %return

Gets whether the print dialog allows user to print a selection.

self

Passed: a <GtkPrintUnixDialog>.

a <GtkPrintUnixDialog>

%return

Returned: a boolean.

whether the application supports print of selection

Procedure: print-unix-dialog:new [title] [parent] ⇒ %return

Creates a new <GtkPrintUnixDialog>.

title

Passed, or left out: a string, or #f.

Title of the dialog

parent

Passed, or left out: a <GtkWindow>, or #f.

Transient parent of the dialog

%return

Returned: a <GtkWidget>.

a new <GtkPrintUnixDialog>

Method: print-unix-dialog:set-current-page self current-page
Method: set-current-page self 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.

self

Passed: a <GtkPrintUnixDialog>.

a <GtkPrintUnixDialog>

current-page

Passed: a 32-bit integer.

the current page number.

Method: print-unix-dialog:set-embed-page-setup self embed
Method: set-embed-page-setup self embed

Embed page size combo box and orientation combo box into page setup page.

self

Passed: a <GtkPrintUnixDialog>.

a <GtkPrintUnixDialog>

embed

Passed: a boolean.

embed page setup selection

Method: print-unix-dialog:set-has-selection self has-selection
Method: set-has-selection self has-selection

Sets whether a selection exists.

self

Passed: a <GtkPrintUnixDialog>.

a <GtkPrintUnixDialog>

has-selection

Passed: a boolean.

#t indicates that a selection exists

Method: print-unix-dialog:set-manual-capabilities self capabilities
Method: set-manual-capabilities self capabilities

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.

self

Passed: a <GtkPrintUnixDialog>.

a <GtkPrintUnixDialog>

capabilities

Passed: a <GtkPrintCapabilities>, or a list of its symbols, or one of them.

the printing capabilities of your application

Method: print-unix-dialog:set-page-setup self page-setup
Method: set-page-setup self page-setup

Sets the page setup of the <GtkPrintUnixDialog>.

self

Passed: a <GtkPrintUnixDialog>.

a <GtkPrintUnixDialog>

page-setup

Passed: a <GtkPageSetup>.

a <GtkPageSetup>

Method: print-unix-dialog:set-settings self [settings]
Method: set-settings self [settings]

Sets the <GtkPrintSettings> for the <GtkPrintUnixDialog>.

Typically, this is used to restore saved print settings from a previous print operation before the print dialog is shown.

self

Passed: a <GtkPrintUnixDialog>.

a <GtkPrintUnixDialog>

settings

Passed, or left out: a <GtkPrintSettings>, or #f.

a <GtkPrintSettings>

Method: print-unix-dialog:set-support-selection self support-selection
Method: set-support-selection self support-selection

Sets whether the print dialog allows user to print a selection.

self

Passed: a <GtkPrintUnixDialog>.

a <GtkPrintUnixDialog>

support-selection

Passed: a boolean.

#t to allow print selection