Hello:
Is it possible to know when the “Preview” button is clicked in the Printer dialog box?
I’m implementing some code to print the text within a DesktopTextArea and I’d like to know if the user clicked the “Preview” button because there is different functionality I’d like to present them with if they click that button.
I’m running Linux Mint 22.3. This button is not unique to Mint, but that’s the distro I’m currently testing with.
This is the code I use to display the Printer dialog box:
var ps As New PrinterSetup
var page As Graphics = ps.ShowPrinterDialog(self)
In short, not easily; not natively in Xojo; and possibly not at all. What are you trying to accomplish? I don’t think I’ve ever seen a system that behaved differently printing vs. preview; the preview is supposed to be a very faithful rendition of what will print and should function exactly the same.
1 Like
Thanks for your feedback, Eric.
The preview button when clicked does the same thing as clicking the print button (it sends the text to the selected printer). Linux is just a different story altogether.
Xojo does detect when (Cancel) is selected, however (page.PrintingCancelled event), which is why I was inquiring about the preview button.
I was planning on intercepting it and displaying my own preview screen.
It’s not a requirement. It’s more of me wanting to figure out how to do it.
With Windows and macOS, things are a bit more consistent. With Linux, it greatly depends on which distro you’re using because it can yield differing results.
I have been writing applications for Linux since 2012.
Why do you need to go through the system’s print preview? Just add your own print preview button or menu and display your own print preview window there. That’s what I’ve done in the past and it works great. (I include a print button on my print preview window that then calls the standard print dialog and prints if that’s what the user wants.)
1 Like
That’s my plan.
I originally figured that I’d just use the button already in the dialog box, however I’ll update my documentation to notify the users so that I don’t get support tickets about it.