Am 08.01.2013 22:46, schrieb Karl Reinl: > Salut, > > is that logical? > For Paint.Begin(<object>) I need a device object. > But if i start a printer with .print, Paint hijacks the printer as > device. > Had some day with blanc pages, while setting Paint.Begin(<printer>) in > printer_Begin(). > What worked when project is started as executable, but not when used as > library. >
Salut Karl, This has caused me some headache before I finally understood that the printer thing now runs completely in its own event loop, but graphics do not. As far as I understand the mechanism, for graphics you still need to point to a device and Paint (or Draw) into it. So you have to define a Begin and End for it within your code. For printers, you simply set the defaults and then start the event loop by saying Printer.Start. The event loop will then touch the appropriate parts in the code by itself. This cleans up code, but it requires you to keep track of the page you are currently in so you can print each content. I'm still working on this one. The drawback is that you cannot simply re-use the same code parts for either printing OR painting into a preview window for example. I haven't solved this problem yet. But maybe I misunderstood your question completely, then simply ignore this :-) Rolf ------------------------------------------------------------------------------ Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery and much more. Keep your Java skills current with LearnJavaNow - 200+ hours of step-by-step video tutorials by Java experts. SALE $49.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122612 _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user