PrintUnixDialog

Description 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 In order to print something with GtkPrintUnixDialog, you need to use gtk_print_unix_dialog_get_selected_printer() to obtain a GtkPrinter object and use it to construct a GtkPrintJob using gtk_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 Printing support was added in GTK+ 2.10. GtkPrintUnixDialog as GtkBuildable The GtkPrintUnixDialog implementation of the GtkBuildable interface exposes its notebook internal children with the name "notebook".

Constructors

this
this(GtkPrintUnixDialog* gtkPrintUnixDialog)

Sets our main struct and passes it to the parent class

this
this(string title, Window parent)

Creates a new GtkPrintUnixDialog. Since 2.10

Members

Functions

addCustomTab
void addCustomTab(Widget child, Widget tabLabel)

Adds a custom tab to the print dialog. Since 2.10

getCurrentPage
int getCurrentPage()

Gets the current page of the GtkPrintDialog. Since 2.10

getEmbedPageSetup
int getEmbedPageSetup()

Gets the value of "embed-page-setup" property. Since 2.18

getHasSelection
int getHasSelection()

Gets the value of "has-selection" property. Since 2.18

getManualCapabilities
GtkPrintCapabilities getManualCapabilities()

Gets the value of "manual-capabilities" property. Since 2.18

getPageSetup
PageSetup getPageSetup()

Gets the page setup that is used by the GtkPrintUnixDialog. Since 2.10

getPageSetupSet
int getPageSetupSet()

Gets the page setup that is used by the GtkPrintUnixDialog. Since 2.18

getPrintSettings
PrintSettings getPrintSettings()

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. Since 2.10

getPrintUnixDialogStruct
GtkPrintUnixDialog* getPrintUnixDialogStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getSelectedPrinter
Printer getSelectedPrinter()

Gets the currently selected printer. Since 2.10

getStruct
void* getStruct()

the main Gtk struct as a void*

getSupportSelection
int getSupportSelection()

Gets the value of "support-selection" property. Since 2.18

setCurrentPage
void setCurrentPage(int currentPage)

Sets the current page number. If current_page is not -1, this enables the current page choice for the range of pages to print. Since 2.10

setEmbedPageSetup
void setEmbedPageSetup(int embed)

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

setHasSelection
void setHasSelection(int hasSelection)

Sets whether a selection exists. Since 2.18

setManualCapabilities
void setManualCapabilities(GtkPrintCapabilities 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. Since 2.10

setPageSetup
void setPageSetup(PageSetup pageSetup)

Sets the page setup of the GtkPrintUnixDialog. Since 2.10

setPrintSettings
void setPrintSettings(PrintSettings 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. Since 2.10

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
setSupportSelection
void setSupportSelection(int supportSelection)

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

Variables

gtkPrintUnixDialog
GtkPrintUnixDialog* gtkPrintUnixDialog;

the main Gtk struct

Inherited Members

From Dialog

gtkDialog
GtkDialog* gtkDialog;

the main Gtk struct

getDialogStruct
GtkDialog* getDialogStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
addButton
Widget addButton(StockID stockID, int responseId)
addButtons
void addButtons(string[] buttonsText, ResponseType[] responses)
addButtons
void addButtons(StockID[] stockIDs, ResponseType[] responses)
getActionArea
HButtonBox getActionArea()

Returns the action area of dialog. Since 2.14

getContentArea
VBox getContentArea()

Returns the content area of dialog. Since 2.14

connectedSignals
int[string] connectedSignals;
onCloseListeners
void delegate(Dialog)[] onCloseListeners;
Undocumented in source.
addOnClose
void addOnClose(void delegate(Dialog) dlg, ConnectFlags connectFlags)

The ::close signal is a keybinding signal which gets emitted when the user uses a keybinding to close the dialog. The default binding for this signal is the Escape key.

callBackClose
void callBackClose(GtkDialog* arg0Struct, Dialog _dialog)
Undocumented in source. Be warned that the author may not have intended to support it.
onResponseListeners
void delegate(gint, Dialog)[] onResponseListeners;
Undocumented in source.
addOnResponse
void addOnResponse(void delegate(gint, Dialog) dlg, ConnectFlags connectFlags)

Emitted when an action widget is clicked, the dialog receives a delete event, or the application programmer calls gtk_dialog_response(). On a delete event, the response ID is GTK_RESPONSE_DELETE_EVENT. Otherwise, it depends on which action widget was clicked. See Also GtkVBox Pack widgets vertically. GtkWindow Alter the properties of your dialog box. GtkButton Add them to the action_area to get a response from the user.

callBackResponse
void callBackResponse(GtkDialog* dialogStruct, gint responseId, Dialog _dialog)
Undocumented in source. Be warned that the author may not have intended to support it.
run
int run()

Blocks in a recursive main loop until the dialog either emits the "response" signal, or is destroyed. If the dialog is destroyed during the call to gtk_dialog_run(), gtk_dialog_run() returns GTK_RESPONSE_NONE. Otherwise, it returns the response ID from the ::response signal emission. Before entering the recursive main loop, gtk_dialog_run() calls gtk_widget_show() on the dialog for you. Note that you still need to show any children of the dialog yourself. During gtk_dialog_run(), the default behavior of "delete-event" is disabled; if the dialog receives ::delete_event, it will not be destroyed as windows usually are, and gtk_dialog_run() will return GTK_RESPONSE_DELETE_EVENT. Also, during gtk_dialog_run() the dialog will be modal. You can force gtk_dialog_run() to return at any time by calling gtk_dialog_response() to emit the ::response signal. Destroying the dialog during gtk_dialog_run() is a very bad idea, because your post-run code won't know whether the dialog was destroyed or not. After gtk_dialog_run() returns, you are responsible for hiding or destroying the dialog if you wish to do so.

response
void response(int responseId)

Emits the "response" signal with the given response ID. Used to indicate that the user has responded to the dialog in some way; typically either you or gtk_dialog_run() will be monitoring the ::response signal and take appropriate action.

addButton
Widget addButton(string buttonText, int responseId)

Adds a button with the given text (or a stock button, if button_text is a stock ID) and sets things up so that clicking the button will emit the "response" signal with the given response_id. The button is appended to the end of the dialog's action area. The button widget is returned, but usually you don't need it.

addActionWidget
void addActionWidget(Widget child, int responseId)

Adds an activatable widget to the action area of a GtkDialog, connecting a signal handler that will emit the "response" signal on the dialog when the widget is activated. The widget is appended to the end of the dialog's action area. If you want to add a non-activatable widget, simply pack it into the action_area field of the GtkDialog struct.

getHasSeparator
int getHasSeparator()

Warning gtk_dialog_get_has_separator has been deprecated since version 2.22 and should not be used in newly-written code. This function will be removed in GTK+ 3 Accessor for whether the dialog has a separator.

setDefaultResponse
void setDefaultResponse(int responseId)

Sets the last widget in the dialog's action area with the given response_id as the default widget for the dialog. Pressing "Enter" normally activates the default widget.

setHasSeparator
void setHasSeparator(int setting)

Warning gtk_dialog_set_has_separator has been deprecated since version 2.22 and should not be used in newly-written code. This function will be removed in GTK+ 3 Sets whether the dialog has a separator above the buttons.

setResponseSensitive
void setResponseSensitive(int responseId, int setting)

Calls gtk_widget_set_sensitive (widget, setting) for each widget in the dialog's action area with the given response_id. A convenient way to sensitize/desensitize dialog buttons.

getResponseForWidget
int getResponseForWidget(Widget widget)

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

getWidgetForResponse
Widget getWidgetForResponse(int responseId)

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

alternativeDialogButtonOrder
int alternativeDialogButtonOrder(Screen screen)

Returns TRUE if dialogs are expected to use an alternative button order on the screen screen. See gtk_dialog_set_alternative_button_order() for more details about alternative button order. If you need to use this function, you should probably connect to the ::notify:gtk-alternative-button-order signal on the GtkSettings object associated to screen, in order to be notified if the button order setting changes. Since 2.6

setAlternativeButtonOrderFromArray
void setAlternativeButtonOrderFromArray(int[] newOrder)

Sets an alternative button order. If the "gtk-alternative-button-order" setting is set to TRUE, the dialog buttons are reordered according to the order of the response ids in new_order. See gtk_dialog_set_alternative_button_order() for more information. This function is for use by language bindings. Since 2.6

Meta