[Gambas-user] Printing from a module
Rolf-Werner Eilert
eilert-sprachen at ...221...
Thu Nov 15 16:47:55 CET 2012
Am 15.11.2012 14:38, schrieb Tobias Boege:
> On Thu, 15 Nov 2012, Rolf-Werner Eilert wrote:
>> Hi folks, I have a question:
>>
>> In FMain I have a Printer object (Printer icon) and a Button to click on
>> for printing.
>>
>> The whole printing procedure should take place in a separate module to
>> keep the lengthy code apart from FMain code.
>>
>> The Button_Click event calls druck.start in the module "druck". But my
>> printing object "drucker" isn't known there.
>>
>> So, what must I write to switch from FMain to the printing module? How
>> can the module know about my printer object?
>>
>> I have made public the forms, I have made public the Printer object. But
>> still its name ("drucker") is unknown in the module.
>
> If you successfully made your control public, I don't know what could be
> wrong but you can still do druck.start(drucker), i.e. give the object as
> a parameter to the module. This would make the code even more generic ;-)
>
> (It _may_ be possible that you just have to use FMain.drucker but I don't
> remember.)
>
Now it runs, I had to use Paint.DrawText instead of Paint.Text.
Rolf
More information about the User
mailing list