Hoogle Search
Within LTS Haskell 24.5 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
printOperationGetNPagesToPrint :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> m Int32gi-gtk3 GI.Gtk.Objects.PrintOperation Returns the number of pages that will be printed. Note that this value is set during print preparation phase (PrintStatusPreparing), so this function should never be called before the data generation phase (PrintStatusGeneratingData). You can connect to the PrintOperation::statusChanged signal and call printOperationGetNPagesToPrint when print status is PrintStatusGeneratingData. This is typically used to track the progress of print operation. Since: 2.18
-
gi-gtk3 GI.Gtk.Objects.PrintOperation Returns the current print settings. Note that the return value is Nothing until either printOperationSetPrintSettings or printOperationRun have been called. Since: 2.10
printOperationGetStatus :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> m PrintStatusgi-gtk3 GI.Gtk.Objects.PrintOperation Returns the status of the print operation. Also see printOperationGetStatusString. Since: 2.10
printOperationGetStatusString :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> m Textgi-gtk3 GI.Gtk.Objects.PrintOperation Returns a string representation of the status of the print operation. The string is translated and suitable for displaying the print status e.g. in a Statusbar. Use printOperationGetStatus to obtain a status value that is suitable for programmatic use. Since: 2.10
printOperationGetSupportSelection :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> m Boolgi-gtk3 GI.Gtk.Objects.PrintOperation Gets the value of PrintOperation:supportSelection property. Since: 2.18
printOperationIsFinished :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> m Boolgi-gtk3 GI.Gtk.Objects.PrintOperation A convenience function to find out if the print operation is finished, either successfully (PrintStatusFinished) or unsuccessfully (PrintStatusFinishedAborted). Note: when you enable print status tracking the print operation can be in a non-finished state even after done has been called, as the operation status then tracks the print job status on the printer. Since: 2.10
printOperationNew :: (HasCallStack, MonadIO m) => m PrintOperationgi-gtk3 GI.Gtk.Objects.PrintOperation Creates a new PrintOperation. Since: 2.10
-
gi-gtk3 GI.Gtk.Objects.PrintOperation Runs the print operation, by first letting the user modify print settings in the print dialog, and then print the document. Normally that this function does not return until the rendering of all pages is complete. You can connect to the PrintOperation::statusChanged signal on op to obtain some information about the progress of the print operation. Furthermore, it may use a recursive mainloop to show the print dialog. If you call printOperationSetAllowAsync or set the PrintOperation:allowAsync property the operation will run asynchronously if this is supported on the platform. The PrintOperation::done signal will be emitted with the result of the operation when the it is done (i.e. when the dialog is canceled, or when the print succeeds or fails).
C code
if (settings != NULL) gtk_print_operation_set_print_settings (print, settings); if (page_setup != NULL) gtk_print_operation_set_default_page_setup (print, page_setup); g_signal_connect (print, "begin-print", G_CALLBACK (begin_print), &data); g_signal_connect (print, "draw-page", G_CALLBACK (draw_page), &data); res = gtk_print_operation_run (print, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, parent, &error); if (res == GTK_PRINT_OPERATION_RESULT_ERROR) { error_dialog = gtk_message_dialog_new (GTK_WINDOW (parent), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "Error printing file:\n%s", error->message); g_signal_connect (error_dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL); gtk_widget_show (error_dialog); g_error_free (error); } else 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)); }
Note that printOperationRun can only be called once on a given PrintOperation. Since: 2.10 printOperationSetAllowAsync :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> Bool -> m ()gi-gtk3 GI.Gtk.Objects.PrintOperation Sets whether the printOperationRun may return before the print operation is completed. Note that some platforms may not allow asynchronous operation. Since: 2.10
printOperationSetCurrentPage :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> Int32 -> m ()gi-gtk3 GI.Gtk.Objects.PrintOperation Sets the current page. If this is called before printOperationRun, the user will be able to select to print only the current page. Note that this only makes sense for pre-paginated documents. Since: 2.10