[Gambas-user] Paint.Begin(<object>) and printer.print

Karl Reinl karl.reinl at ...9...
Tue Jan 15 12:01:15 CET 2013


Am Mittwoch, den 09.01.2013, 11:18 +0100 schrieb Benoît Minisini:
> Le 09/01/2013 11:11, Charlie Reinl a écrit :
> > Am Dienstag, den 08.01.2013, 22:50 +0100 schrieb Benoît Minisini:
> >> Le 08/01/2013 22:46, Karl Reinl a écrit :
> >>> 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.
> >>>
> >>
> >> Sorry, I don't understand a word. :-/
> >>
> >
> > Ok, so I'll try to explain it in a another way:
> >
> > normally if you want to use Paint, you have to start with
> > Paint.Begin(<Device>)
> >
> > Paint.Begin() needs the Device, to which it should paint.
> >
> > Paint is also used by the printer.
> >
> > The difference is :
> > while for other devices you declare it in Paint.Begin(<Device>),
> > the printer, becomes with  <printer>.print the painting device.
> >
> > That is what I call 'Paint hijacks the printer as device'
> 
> Yes, exactly like DrawingArea.
> 
> >
> > And the problem is : if you call on <printer>_Begin() event a
> > Paint.Begin(<printer>) that will work standalone executables ,
> > but not in libraries.
> 
> You don't have to call Paint.Begin() in the Begin event handler. This is 
> done automatically just before raising the event.

	yes, that I know now.
> 
> I don't understand what does not work in libraries.

I do not understand too, I haven't isolated it, but later that week I
will try to make an example.

Shortly: 
take a project where you are printing, add at <printer>_Begin() event
the Paint.Begin(<printer>), add 'Export' to the Startup and make it a
library.

run as executable it prints fine

Now make a new project that insert the  previous project as library ,
call it, and try to print.


Salut,

now I'm back, I have made an example and I'm no more sure it is the
Paint.Begin(<printer>).

The application don't find his variable values when painting to the
printer.

I have a workaround, but I'm interested whether it is a bug or not.

If you use only ThePrinter every thing work ok.
But if you use ThePrinterCaller, the text to print gets lost.
The workaround is to store it outside the form, like the checkBox value
too.


-- 
Amicalement
Charlie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ThePrinter-0.0.18.tar.gz
Type: application/x-compressed-tar
Size: 11025 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20130115/5539cb87/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ThePrinterCaller-0.0.4.tar.gz
Type: application/x-compressed-tar
Size: 8741 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20130115/5539cb87/attachment-0001.bin>


More information about the User mailing list