Hoogle Search
Within LTS Haskell 24.20 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
PrintDialog :: ManagedPtr PrintDialog -> PrintDialoggi-gtk4 GI.Gtk.Objects.PrintDialog No documentation available.
module GI.Gtk.Objects.
PrintJob A GtkPrintJob object represents a job that is sent to a printer. You only need to deal directly with print jobs if you use the non-portable PrintUnixDialog API. Use printJobGetSurface to obtain the cairo surface onto which the pages must be drawn. Use printJobSend to send the finished job to the printer. If you don’t use cairo GtkPrintJob also supports printing of manually generated PostScript, via printJobSetSourceFile.
-
gi-gtk4 GI.Gtk.Objects.PrintJob Memory-managed wrapper type.
PrintJob :: ManagedPtr PrintJob -> PrintJobgi-gtk4 GI.Gtk.Objects.PrintJob No documentation available.
type
PrintJobStatusChangedCallback = IO ()gi-gtk4 GI.Gtk.Objects.PrintJob Emitted when the status of a job changes. The signal handler can use printJobGetStatus to obtain the new status.
module GI.Gtk.Objects.
PrintOperation GtkPrintOperation is the high-level, portable printing API. It looks a bit different than other GTK dialogs such as the GtkFileChooser, since some platforms don’t expose enough infrastructure to implement a good print dialog. On such platforms, GtkPrintOperation uses the native print dialog. On platforms which do not provide a native print dialog, GTK uses its own, see PrintUnixDialog. The typical way to use the high-level printing API is to create a GtkPrintOperation object with printOperationNew when the user selects to print. Then you set some properties on it, e.g. the page size, any PrintSettings from previous print operations, the number of pages, the current page, etc. Then you start the print operation by calling printOperationRun. It will then show a dialog, let the user select a printer and options. When the user finished the dialog, various signals will be emitted on the GtkPrintOperation, the main one being PrintOperation::drawPage, which you are supposed to handle and render the page on the provided PrintContext using Cairo.
The high-level printing API
c code
static GtkPrintSettings *settings = NULL; static void do_print (void) { GtkPrintOperation *print; GtkPrintOperationResult res; print = gtk_print_operation_new (); if (settings != NULL) gtk_print_operation_set_print_settings (print, settings); g_signal_connect (print, "begin_print", G_CALLBACK (begin_print), NULL); g_signal_connect (print, "draw_page", G_CALLBACK (draw_page), NULL); res = gtk_print_operation_run (print, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, GTK_WINDOW (main_window), NULL); if (res == GTK_PRINT_OPERATION_RESULT_APPLY) { if (settings != NULL) g_object_unref (settings); settings = g_object_ref (gtk_print_operation_get_print_settings (print)); } g_object_unref (print); }By default GtkPrintOperation uses an external application to do print preview. To implement a custom print preview, an application must connect to the preview signal. The functions printOperationPreviewRenderPage, printOperationPreviewEndPreview and printOperationPreviewIsSelected are useful when implementing a print preview.-
gi-gtk4 GI.Gtk.Objects.PrintOperation Memory-managed wrapper type.
PrintOperation :: ManagedPtr PrintOperation -> PrintOperationgi-gtk4 GI.Gtk.Objects.PrintOperation No documentation available.
type
PrintOperationBeginPrintCallback = PrintContext -> IO ()gi-gtk4 GI.Gtk.Objects.PrintOperation Emitted after the user has finished changing print settings in the dialog, before the actual rendering starts. A typical use for beginPrint is to use the parameters from the PrintContext and paginate the document accordingly, and then set the number of pages with printOperationSetNPages.
type
PrintOperationCreateCustomWidgetCallback = IO Maybe Objectgi-gtk4 GI.Gtk.Objects.PrintOperation Emitted when displaying the print dialog. If you return a widget in a handler for this signal it will be added to a custom tab in the print dialog. You typically return a container widget with multiple widgets in it. The print dialog owns the returned widget, and its lifetime is not controlled by the application. However, the widget is guaranteed to stay around until the PrintOperation::customWidgetApply signal is emitted on the operation. Then you can read out any information you need from the widgets.