wxPrinter(3)
β¨ 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
wxPrintDialogwxPrintoutwxPrintPreview- 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:
wxPrintDialogDatawxPrintData
print(This, Parent, Printout, [Option]) -> boolean()
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
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms