PrintUnixDialog

gtk.print_unix_dialog.PrintUnixDialog implements a print dialog for platforms which don’t provide a native print dialog, like Unix.

An example GtkPrintUnixDialog

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 gtk.print_operation.PrintOperation.

In order to print something with gtk.print_unix_dialog.PrintUnixDialog, you need to use gtk.print_unix_dialog.PrintUnixDialog.getSelectedPrinter to obtain a gtk.printer.Printer object and use it to construct a gtk.print_job.PrintJob using gtk.print_job.PrintJob.new_.

gtk.print_unix_dialog.PrintUnixDialog uses the following response values:

GtkPrintUnixDialog as GtkBuildable

The gtk.print_unix_dialog.PrintUnixDialog implementation of the gtk.buildable.Buildable interface exposes its @notebook internal children with the name “notebook”.

An example of a gtk.print_unix_dialog.PrintUnixDialog 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

gtk.print_unix_dialog.PrintUnixDialog has a single CSS node with name window. The style classes dialog and print are added.

Constructors

this
this(string title, gtk.window.Window parent)

Creates a new gtk.print_unix_dialog.PrintUnixDialog.

Members

Functions

addCustomTab
void addCustomTab(gtk.widget.Widget child, gtk.widget.Widget tabLabel)

Adds a custom tab to the print dialog.

getCurrentPage
int getCurrentPage()

Gets the current page of the gtk.print_unix_dialog.PrintUnixDialog.

getEmbedPageSetup
bool getEmbedPageSetup()

Gets whether to embed the page setup.

getHasSelection
bool getHasSelection()

Gets whether there is a selection.

getManualCapabilities
gtk.types.PrintCapabilities getManualCapabilities()

Gets the capabilities that have been set on this gtk.print_unix_dialog.PrintUnixDialog.

getPageSetup
gtk.page_setup.PageSetup getPageSetup()

Gets the page setup that is used by the gtk.print_unix_dialog.PrintUnixDialog.

getPageSetupSet
bool getPageSetupSet()

Gets whether a page setup was set by the user.

getSelectedPrinter
gtk.printer.Printer getSelectedPrinter()

Gets the currently selected printer.

getSettings
gtk.print_settings.PrintSettings getSettings()

Gets a new gtk.print_settings.PrintSettings object that represents the current values in the print dialog.

getSupportSelection
bool getSupportSelection()

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

setCurrentPage
void setCurrentPage(int currentPage)

Sets the current page number.

setEmbedPageSetup
void setEmbedPageSetup(bool embed)

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

setHasSelection
void setHasSelection(bool hasSelection)

Sets whether a selection exists.

setManualCapabilities
void setManualCapabilities(gtk.types.PrintCapabilities capabilities)

This lets you specify the printing capabilities your application supports.

setPageSetup
void setPageSetup(gtk.page_setup.PageSetup pageSetup)

Sets the page setup of the gtk.print_unix_dialog.PrintUnixDialog.

setSettings
void setSettings(gtk.print_settings.PrintSettings settings)

Sets the gtk.print_settings.PrintSettings for the gtk.print_unix_dialog.PrintUnixDialog.

setSupportSelection
void setSupportSelection(bool supportSelection)

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

Inherited Members

From Dialog

addActionWidget
void addActionWidget(gtk.widget.Widget child, int responseId)

Adds an activatable widget to the action area of a gtk.dialog.Dialog.

addButton
gtk.widget.Widget addButton(string buttonText, int responseId)

Adds a button with the given text.

getContentArea
gtk.box.Box getContentArea()

Returns the content area of dialog.

getHeaderBar
gtk.header_bar.HeaderBar getHeaderBar()

Returns the header bar of dialog.

getResponseForWidget
int getResponseForWidget(gtk.widget.Widget widget)

Gets the response id of a widget in the action area of a dialog.

getWidgetForResponse
gtk.widget.Widget getWidgetForResponse(int responseId)

Gets the widget button that uses the given response ID in the action area of a dialog.

response
void response(int responseId)

Emits the ::response signal with the given response ID.

setDefaultResponse
void setDefaultResponse(int responseId)

Sets the default widget for the dialog based on the response ID.

setResponseSensitive
void setResponseSensitive(int responseId, bool setting)

A convenient way to sensitize/desensitize dialog buttons.

connectClose
ulong connectClose(T callback, Flag!"After" after)

Connect to Close signal.

connectResponse
ulong connectResponse(T callback, Flag!"After" after)

Connect to Response signal.