Class: Gtk::PrintDialog

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Constructor Details

#initializeGtk::PrintDialog

Creates a new GtkPrintDialog object.

Instance Method Details

#accept_labelString

A label that may be shown on the accept button of a print dialog
that is presented by [methodGtk.PrintDialog.setup].

Returns:

  • (String)

    accept-label

#accept_label=(accept_label) ⇒ String

A label that may be shown on the accept button of a print dialog
that is presented by [methodGtk.PrintDialog.setup].

Parameters:

  • accept_label (String)

Returns:

  • (String)

    accept-label

  • (String)

    accept-label

Returns whether the print dialog blocks
interaction with the parent window while
it is presented.

Returns:

  • (Boolean)

    whether the print dialog is modal

#modal=(modal) ⇒ Boolean

Whether the print dialog is modal.

Parameters:

  • modal (Boolean)

Returns:

  • (Boolean)

    modal

  • (Boolean)

    modal

#modal?Boolean

Whether the print dialog is modal.

Returns:

  • (Boolean)

    modal

#page_setupGtk::PageSetup

The page setup to use.

Returns:

#page_setup=(page_setup) ⇒ Gtk::PageSetup

The page setup to use.

Parameters:

Returns:

This function prints content from a stream.

If you pass NULL as setup, then this method will present a print dialog.
Otherwise, it will attempt to print directly, without user interaction.

The callback will be called when the printing is done. It should call
[methodGtk.PrintDialog.print_finish] to obtain the results.

Parameters:

  • parent (Gtk::Window)

    the parent GtkWindow

  • setup (Gtk::PrintSetup)

    the GtkPrintSetup to use

  • cancellable (Gio::Cancellable)

    a GCancellable to cancel the operation

  • callback (Gio::AsyncReadyCallback)

    a callback to call when the operation is complete

  • user_data (GObject)

    data to pass to callback

Returns:

  • (nil)

This function prints a file.

If you pass NULL as setup, then this method will present a print dialog.
Otherwise, it will attempt to print directly, without user interaction.

The callback will be called when the printing is done. It should call
[methodGtk.PrintDialog.print_file_finish] to obtain the results.

Parameters:

  • parent (Gtk::Window)

    the parent GtkWindow

  • setup (Gtk::PrintSetup)

    the GtkPrintSetup to use

  • file (Gio::File)

    the GFile to print

  • cancellable (Gio::Cancellable)

    a GCancellable to cancel the operation

  • callback (Gio::AsyncReadyCallback)

    a callback to call when the operation is complete

  • user_data (GObject)

    data to pass to callback

Returns:

  • (nil)

Finishes the [methodGtk.PrintDialog.print_file] call and
returns the results.

Parameters:

  • result (Gio::AsyncResult)

    a GAsyncResult

Returns:

  • (Boolean)

    Whether the call was successful

Finishes the [methodGtk.PrintDialog.print] call and
returns the results.

If the call was successful, the content to be printed should be
written to the returned output stream. Otherwise, NULL is returned.

The overall results of the print operation will be returned in the
[methodGio.OutputStream.close] call, so if you are interested in the
results, you need to explicitly close the output stream (it will be
closed automatically if you just unref it). Be aware that the close
call may not be instant as it operation will for the printer to finish
printing.

Parameters:

  • result (Gio::AsyncResult)

    a GAsyncResult

Returns:

  • (Gio::OutputStream)

    a [classGio.OutputStream]

The print settings to use.

Returns:

The print settings to use.

Parameters:

Returns:

#setup(parent, cancellable, callback, user_data) ⇒ nil

This function presents a print dialog to let the user select a printer,
and set up print settings and page setup.

The callback will be called when the dialog is dismissed.
It should call [methodGtk.PrintDialog.setup_finish]
to obtain the results in the form of a [structGtk.PrintSetup],
that can then be passed to [methodGtk.PrintDialog.print]
or [methodGtk.PrintDialog.print_file].

One possible use for this method is to have the user select a printer,
then show a page setup UI in the application (e.g. to arrange images
on a page), then call [methodGtk.PrintDialog.print] on self
to do the printing without further user interaction.

Parameters:

  • parent (Gtk::Window)

    the parent GtkWindow

  • cancellable (Gio::Cancellable)

    a GCancellable to cancel the operation

  • callback (Gio::AsyncReadyCallback)

    a callback to call when the operation is complete

  • user_data (GObject)

    data to pass to callback

Returns:

  • (nil)

#setup_finish(result) ⇒ Gtk::PrintSetup

Finishes the [methodGtk.PrintDialog.setup] call.

If the call was successful, it returns a [structGtk.PrintSetup]
which contains the print settings and page setup information that
will be used to print.

Parameters:

  • result (Gio::AsyncResult)

    a GAsyncResult

Returns:

  • (Gtk::PrintSetup)

    The GtkPrintSetup object that resulted from the call,
    or NULL if the call was not successful

#titleString

A title that may be shown on the print dialog that is
presented by [methodGtk.PrintDialog.setup].

Returns:

  • (String)

    title

#title=(title) ⇒ String

A title that may be shown on the print dialog that is
presented by [methodGtk.PrintDialog.setup].

Parameters:

  • title (String)

Returns:

  • (String)

    title

  • (String)

    title