Am Freitag, den 05.02.2010, 17:45 +0100 schrieb Doriano Blengino: > Charlie Reinl ha scritto: > > Am Freitag, den 05.02.2010, 17:06 +0100 schrieb Doriano Blengino: > > > >> Charlie Reinl ha scritto: > >> > >>>>> So I repeat my question, where/how can I see/test the output device, > >>>>> after printer.setup. > >>>>> > >>>>> > >>>>> > >>>> Printer.name. > >>>> This name identifies a CUPS device, and has little to do with the > >>>> physical device. > >>>> > >>>> > >>>> > >>>> > >>> Salut, > >>> > >>> about Printer.Setup() > >>> > >>> It is easily possible to leave Printer.Setup() with the Printer.Name and > >>> the Printer.file filled (see attached Printer Properties.png) > >>> > >>> This happened, while jumping between, "Print to printer" and "Print to > >>> file" or simply when your Printer object is called several times with > >>> different targets. > >>> > >>> The Printer object knows, what to do, so there is not the problem. > >>> But if the gambas-coder, after leaving the Printer.Setup(), wants to > >>> know if "Print to printer" or "Print to file" was chosen, he has as > >>> possibility only to ask if Printer.Name or Printer.file are filled. > >>> > >>> And that can be (as in Printer Properties.png shown) both one. > >>> > >>> So what is needed, is a "target property" which says something like > >>> target = printer or target = file > >>> > >>> Gambas2=2.19.0 Revision: 2654 > >>> qt > >>> > >>> > >> It seems to me, but I could be wrong, that if printer.file is filled, > >> then the job goes to a file. If it is empty, then the job goes to a > >> "real" printer. About the setup() dialog, may be it is bugged - I mean, > >> perhaps it is possible to close the dialog and have both printer.file > >> and printer.name set. > >> > >> === correction === > >> it is bugged. > >> I made a simple project where setup() is called and just after return > >> the values of .file and .name are printed. It is so easy to get them > >> both set... > >> > >> -- BUT THERE IS A WORKAROUND -- > >> > >> Just set printer.file="" before invoking setup(). Apparently they did > >> more work than what is documented. This solves. The printer.file get set > >> only if you press OK having "Print to file" checked. > >> > >> > > > > That works for a clean entry. But do it also for Printer.Name > > > > > No, the result after > > printer.file = "" > printer.setup > > is predictable: > > if printer.file<>"" then > ' output goes to a file > printer.copies=1 > else > ' output goes to a real printer > application.messagebox("Take the toasting bread out of the printer > named " & printer.name) > application.messagebox("Now put some blank paper into the printer") > endif > > ...or am I missing something? Salut,
just something to play and see. -- Amicalement Charlie
PrinterSetup-0.0.1.tar.gz
Description: application/compressed-tar
------------------------------------------------------------------------------ The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com
_______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user