Gtk2::P...eration(3)

πŸ“¦
version 1.24993 Β· 2 versions
, in fedora 43

🌸 Gtk2::PrintOperation πŸ’–

ok bestie sit down because we're talking about Gtk2::PrintOperation, and it is literally just a wrapper for GtkPrintOperation β€” that's the entire job description, no cap. πŸŽ€

(also hi yes this is the User Contributed Perl Documentation version, section 3, so it's the Perl-flavored one, not the C one. iykyk.)


πŸ¦‹ HIERARCHY

Glib::Object
+----Gtk2::PrintOperation

🧚 INTERFACES

Gtk2::PrintOperationPreview β€” yeah she does that too πŸ’…


✨ METHODS ✨

  • printoperation = Gtk2::PrintOperation->new β€” the constructor, your main character entrance 🫢
  • $op->set_allow_async ($allow_async)
    • $allow_async (boolean)
  • $op->cancel β€” cancel it. periodt.
  • $op->set_current_page ($current_page)
    • $current_page (integer)
  • $op->set_custom_tab_label ($label)
    • $label (string)
  • pagesetup or undef = $op->get_default_page_setup
  • $op->set_default_page_setup ($default_page_setup)
    • $default_page_setup (Gtk2::PageSetup or undef)
  • $op->set_defer_drawing ()
⚠️ bestie. set_defer_drawing() can only be called from the callback 'draw-page'. that's it. no other time. πŸ™ˆ

Since: gtk+ 2.16

  • $op->draw_page_finish ()
πŸ’€ ok listen. draw_page_finish() can only be called if you already called set_defer_drawing() first. if you didn't, you get a segmentation fault. like, the application will crash, and even an eval will not be able to recover from that error. not even eval!! she does not forgive.

Since: gtk+ 2.16

  • boolean = $op->get_embed_page_setup

Since: gtk+ 2.18

  • $op->set_embed_page_setup ($embed)
    • $embed (boolean)

Since: gtk+ 2.18

  • scalar = $op->get_error
  • $op->set_export_filename ($filename)
    • $filename (string)
  • boolean = $op->get_has_selection

Since: gtk+ 2.18

  • $op->set_has_selection ($has_selection)
    • $has_selection (boolean)

Since: gtk+ 2.18

  • boolean = $op->is_finished
  • $op->set_job_name ($job_name)
    • $job_name (string)
  • $op->set_n_pages ($n_pages)
    • $n_pages (integer)
  • integer = $op->get_n_pages_to_print

Since: gtk+ 2.18

  • printsettings or undef = $op->get_print_settings
  • $op->set_print_settings ($print_settings)
    • $print_settings (Gtk2::PrintSettings or undef)
  • printoperationresult = $op->run ($action, $parent)
    • $action (Gtk2::PrintOperationAction)
    • $parent (Gtk2::Window or undef)
🫢 heads up: this one may croak with a Glib::Error in $@ on failure. wrap it, bestie.
  • $op->set_show_progress ($show_progress)
    • $show_progress (boolean)
  • printstatus = $op->get_status
  • string = $op->get_status_string
  • boolean = $op->get_support_selection

Since: gtk+ 2.18

  • $op->set_support_selection ($support_selection)
    • $support_selection (boolean)

Since: gtk+ 2.18

  • $op->set_track_print_status ($track_status)
    • $track_status (boolean)
  • $op->set_unit ($unit)
    • $unit (Gtk2::Unit)
  • $op->set_use_full_page ($full_page)
    • $full_page (boolean)

πŸŽ€ PROPERTIES πŸŽ€

  • 'allow-async' (boolean : default false : readable / writable / private / static-nick / static-blurb) β€” TRUE if print process may run asynchronous.
  • 'current-page' (integer : default -1 : readable / writable / private / static-nick / static-blurb) β€” The current page in the document
  • 'custom-tab-label' (string : default undef : readable / writable / private / static-nick / static-blurb) β€” Label for the tab containing custom widgets.
  • 'default-page-setup' (Gtk2::PageSetup : default undef : readable / writable / private / static-nick / static-blurb) β€” The GtkPageSetup used by default
  • 'embed-page-setup' (boolean : default false : readable / writable / private / static-nick / static-blurb) β€” TRUE if page setup combos are embedded in GtkPrintDialog
  • 'export-filename' (string : default undef : readable / writable / private / static-nick / static-blurb) β€” Export filename
  • 'has-selection' (boolean : default false : readable / writable / private / static-nick / static-blurb) β€” TRUE if a selection exists.
  • 'job-name' (string : default "" : readable / writable / private / static-nick / static-blurb) β€” A string used for identifying the print job.
  • 'n-pages' (integer : default -1 : readable / writable / private / static-nick / static-blurb) β€” The number of pages in the document.
  • 'n-pages-to-print' (integer : default -1 : readable / private / static-nick / static-blurb) β€” The number of pages that will be printed.
  • 'print-settings' (Gtk2::PrintSettings : default undef : readable / writable / private / static-nick / static-blurb) β€” The GtkPrintSettings used for initializing the dialog
  • 'show-progress' (boolean : default false : readable / writable / private / static-nick / static-blurb) β€” TRUE if a progress dialog is shown while printing.
  • 'status' (Gtk2::PrintStatus : default "initial" : readable / private / static-nick / static-blurb) β€” The status of the print operation
  • 'status-string' (string : default "" : readable / private / static-nick / static-blurb) β€” A human-readable description of the status
  • 'support-selection' (boolean : default false : readable / writable / private / static-nick / static-blurb) β€” TRUE if the print operation will support print of selection.
  • 'track-print-status' (boolean : default false : readable / writable / private / static-nick / static-blurb) β€” TRUE if the print operation will continue to report on the print job status after the print data has been sent to the printer or print server.
  • 'unit' (Gtk2::Unit : default "pixel" : readable / writable / private / static-nick / static-blurb) β€” The unit in which distances can be measured in the context
  • 'use-full-page' (boolean : default false : readable / writable / private / static-nick / static-blurb) β€” TRUE if the origin of the context should be at the corner of the page and not the corner of the imageable area

πŸ”₯ SIGNALS πŸ”₯

  • begin-print (Gtk2::PrintOperation, Gtk2::PrintContext)
  • Glib::Object = create-custom-widget (Gtk2::PrintOperation)
  • custom-widget-apply (Gtk2::PrintOperation, Gtk2::Widget)
  • done (Gtk2::PrintOperation, Gtk2::PrintOperationResult)
  • draw-page (Gtk2::PrintOperation, Gtk2::PrintContext, integer)
  • end-print (Gtk2::PrintOperation, Gtk2::PrintContext)
  • boolean = paginate (Gtk2::PrintOperation, Gtk2::PrintContext)
  • boolean = preview (Gtk2::PrintOperation, Gtk2::PrintOperationPreview, Gtk2::PrintContext, Gtk2::Window)
  • request-page-setup (Gtk2::PrintOperation, Gtk2::PrintContext, integer, Gtk2::PageSetup)
  • status-changed (Gtk2::PrintOperation)
  • update-custom-widget (Gtk2::PrintOperation, Gtk2::Widget, Gtk2::PageSetup, Gtk2::PrintSettings)

🌈 ENUMS AND FLAGS 🌈

🌟 enum Gtk2::PrintOperationAction

  • 'print-dialog' / 'GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG'
  • 'print' / 'GTK_PRINT_OPERATION_ACTION_PRINT'
  • 'preview' / 'GTK_PRINT_OPERATION_ACTION_PREVIEW'
  • 'export' / 'GTK_PRINT_OPERATION_ACTION_EXPORT'

🌟 enum Gtk2::PrintOperationResult

  • 'error' / 'GTK_PRINT_OPERATION_RESULT_ERROR'
  • 'apply' / 'GTK_PRINT_OPERATION_RESULT_APPLY'
  • 'cancel' / 'GTK_PRINT_OPERATION_RESULT_CANCEL'
  • 'in-progress' / 'GTK_PRINT_OPERATION_RESULT_IN_PROGRESS'

🌟 enum Gtk2::PrintStatus

  • 'initial' / 'GTK_PRINT_STATUS_INITIAL'
  • 'preparing' / 'GTK_PRINT_STATUS_PREPARING'
  • 'generating-data' / 'GTK_PRINT_STATUS_GENERATING_DATA'
  • 'sending-data' / 'GTK_PRINT_STATUS_SENDING_DATA'
  • 'pending' / 'GTK_PRINT_STATUS_PENDING'
  • 'pending-issue' / 'GTK_PRINT_STATUS_PENDING_ISSUE'
  • 'printing' / 'GTK_PRINT_STATUS_PRINTING'
  • 'finished' / 'GTK_PRINT_STATUS_FINISHED'
  • 'finished-aborted' / 'GTK_PRINT_STATUS_FINISHED_ABORTED'

🌟 enum Gtk2::Unit

  • 'pixel' / 'GTK_UNIT_PIXEL'
  • 'points' / 'GTK_UNIT_POINTS'
  • 'inch' / 'GTK_UNIT_INCH'
  • 'mm' / 'GTK_UNIT_MM'

πŸ‘‘ SEE ALSO πŸ‘‘

Gtk2, Glib::Object β€” go read those next bestie, they're the whole family 🫢


Copyright (C) 2003-2011 by the gtk2-perl team.

This software is licensed under the LGPL. See Gtk2 for a full notice.


ok that's the whole page, no crumbs left 🌸 this was Gtk2::P...eration(3) from the User Contributed Perl Documentation, brought to you by perl v5.42.0 on 2025-07-25. slay, go print something πŸ’…βœ¨

πŸ“¦ where this page comes from