wxPrinter(3)

πŸ“¦
version 29.0.6 Β· 3 versions
, in ubuntu stonking

✨ wxPrinter ✨

okay bestie, welcome to the wxPrinter page of the Erlang module docs πŸ’… it's a <cyan>wx</cyan> module definition, and this lil class is honestly giving main character energy.


πŸŽ€ NAME πŸŽ€

wxPrinter β€” this class represents the Windows or PostScript printer, and it's literally the vehicle through which printing may be launched by an application. πŸ–¨οΈβœ¨


🌸 DESCRIPTION 🌸

so you could do printing through the lower-level functions and classes, but ngl, this class plus its associated besties give you a way more convenient and general method of printing. it's the glow-up path. πŸ¦‹

See:

  • Overview printing
  • wxPrintDialog
  • wxPrintout
  • wxPrintPreview
  • wxWidgets docs: wxPrinter

πŸ’œ DATA TYPES πŸ’œ

  • wxPrinter() :: wx:wx_object().

πŸ‘‘ FUNCTIONS πŸ‘‘

createAbortWindow(This, Parent, Printout) -> wxDialog:wxDialog()

when
    This :: wxPrinter(),
    Parent :: wxWindow:wxWindow(),
    Printout :: wxPrintout:wxPrintout().

Creates the default printing abort window, with a cancel button. so if someone wants to bail on the whole thing, there's a button for that πŸ›‘


destroy(This :: wxPrinter()) -> ok.

Destroys the object. it's over, it's done, say bye πŸ‘‹πŸ’€


getAbort(This) -> boolean()

when This :: wxPrinter().

Returns true if the user has aborted the print job. like, they said no thank you and walked away πŸ™ˆ


getLastError() -> wx:wx_enum().

Return last error. πŸ“‹

Valid after calling print/4, printDialog/2 or wxPrintPreview:print/2.

These functions set last error to wxPRINTER_NO_ERROR if no error happened. (iconic behavior, honestly 🫢)

Returned value is one of the following:

lowkey the list of values is empty right here in the docs bestie, so we're just gonna hold that thought πŸ’€

getPrintDialogData(This) -> wxPrintDialogData:wxPrintDialogData()

when This :: wxPrinter().

Returns the print data associated with the printer object. it's giving "here's what this printer knows about itself" πŸ’…


new([Option]) -> wxPrinter()

when
    Option :: {data, wxPrintDialogData:wxPrintDialogData()}.

Constructor. ✨

Pass an optional pointer to a block of print dialog data, which will be copied to the printer object's local data.

See:

  • wxPrintDialogData
  • wxPrintData

when
    This :: wxPrinter(),
    Parent :: wxWindow:wxWindow(),
    Printout :: wxPrintout:wxPrintout(),
    Option :: {prompt, boolean()}.

Starts the printing process. πŸš€πŸ–¨οΈ

Provide a parent window, a user-defined wxPrintout object which controls the printing of a document, and whether the print dialog should be invoked first.

print/4 could return false if there was a problem initializing the printer device context (current printer not set, for example) or the user cancelled printing. Call getLastError/0 to get detailed information about the kind of the error. so like, if it ghosts you with a false, that's your 411 hotline πŸ“ž


printDialog(This, Parent) -> wxDC:wxDC()

when
    This :: wxPrinter(),
    Parent :: wxWindow:wxWindow().

Invokes the print dialog. πŸ—¨οΈ

If successful (the user did not press Cancel and no error occurred), a suitable device context will be returned; otherwise NULL is returned; call getLastError/0 to get detailed information about the kind of the error.

Remark: the application must delete this device context to avoid a memory leak. bestie, I am BEGGING you, do not leave that context hanging. delete it. periodt. 🫠

reportError(This, Parent, Printout, Message) -> ok

when
    This :: wxPrinter(),
    Parent :: wxWindow:wxWindow(),
    Printout :: wxPrintout:wxPrintout(),
    Message :: unicode:chardata().

Default error-reporting function. when things go sideways, this is the one who tells you πŸ“’πŸ˜­


setup(This, Parent) -> boolean()

when This :: wxPrinter(), Parent :: wxWindow:wxWindow().

Invokes the print setup dialog. βš™οΈ

Deprecated:

The setup dialog is obsolete, though retained for backward compatibility.

so like, it's still here, but it's giving vintage. use it for the old code, not for new vibes πŸ’€πŸ•°οΈ

that's the whole page bestie, no details left behind, we ate and left no crumbs πŸ“βœ¨

this was wxPrinter(3) from the Erlang module definitions β€” brought to you by Ericsson AB, version wx 2.6, dated wxPrinter(3). mwah πŸ’–

πŸ“¦ where this page comes from