[Gambas-user] I need simple example

M. Cs. mohareve at ...626...
Sat Jun 25 20:01:15 CEST 2011


Well, I tried the example you gave me, but it is full of errors!

I've modified like this:

PUBLIC hPrinter as Printer


 Public sub _New()

  hPrinter = new Printer

  if not hPrinter.configure() then
   'you must to define the numbers of pages before
   hPrinter.count = 1
   'Launch the printing
   hPrinter.Print
  endif

 end


 Public sub hPrinter_Draw()

  Paint.Font.Size=12
  Paint.Text(myText,564,457)
  'fill the vectorialpath
  Paint.Fill

 end

But it prints empty pages only!
Any correction?

2011/6/25, M. Cs. <mohareve at ...626...>:
> Thanks!
>
> Csaba
>
> 2011/6/25, Fabien Bodard <gambas.fr at ...626...>:
>> Dim hPrinter as Printer
>>
>>
>> Public sub _New()
>>
>>   hPrinter = new Printer(me) as "Printer"
>>
>>   if not Printer.configure() then
>>    'you must to define the numbers of pages before
>>    printer.count = 1
>>    'Launch the printing
>>    printer.print
>>   endif
>>
>> end
>>
>>
>> Public sub Printer_Draw()
>>
>>   Paint.Font.Size=12
>>   Paint.Text(myText,564,457)
>>   'fill the vectorialpath
>>   Paint.Fill
>>
>> end
>>
>>
>>
>>
>> 2011/6/25 M. Cs. <mohareve at ...626...>:
>>> Hi,
>>> I know how to print text in G2, but I'd need a simple transcription
>>> for the following G2 code to G3:
>>>
>>> PUBLIC SUB ExecutePrint(mytext)
>>>
>>> IF Printer.Setup() THEN RETURN
>>> Printer.Resolution = 300
>>> Draw.Begin(Printer)
>>> Draw.Font.Size = 12
>>> Draw.Text(mytext, 564, 457)
>>> Draw.End
>>>
>>> END
>>>
>>> The examples prepared for the GUI are much too complicated (were also in
>>> G2).
>>> "Simplicity!" (Hannibal Lecter)
>>>
>>> Thanks!
>>>
>>> ------------------------------------------------------------------------------
>>> All the data continuously generated in your IT infrastructure contains a
>>> definitive record of customers, application performance, security
>>> threats, fraudulent activity and more. Splunk takes this data and makes
>>> sense of it. Business sense. IT sense. Common sense..
>>> http://p.sf.net/sfu/splunk-d2d-c1
>>> _______________________________________________
>>> Gambas-user mailing list
>>> Gambas-user at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>>
>>
>>
>>
>> --
>> Fabien Bodard
>>
>> ------------------------------------------------------------------------------
>> All the data continuously generated in your IT infrastructure contains a
>> definitive record of customers, application performance, security
>> threats, fraudulent activity and more. Splunk takes this data and makes
>> sense of it. Business sense. IT sense. Common sense..
>> http://p.sf.net/sfu/splunk-d2d-c1
>> _______________________________________________
>> Gambas-user mailing list
>> Gambas-user at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
>




More information about the User mailing list