Tomas Eroles i Forner wrote:
> Hi again
> Well, I've made some research in DrawingArea.
> I've been reading the documentation on the wiki, and, if I understand
> it, for drawing I have to draw into a DrawingArea enclosing all draw
> commands in a Draw.Begin(DrawingArea)...Draw.End group of code.
>
> It seems to work, but, I see that you can start drawing if you put a
> command button, or a menu or something like this, but it does not work
> in a Form_Open event.
>
> Is it like this?
>
> Thanks
>   
It is meant to be used somewhat differently.
You can put all your drawing commands in a

Draw.Begin(DrawingArea)...Draw.End group of code.

However, it is much more practical to use the drawing area's draw event
http://gambasdoc.org/help/comp/gb.qt/drawingarea/.draw

because it will also deal with needs to redraw that come from outside the 
application i.e.other applications' windows that were partially overlapping. 
Have a look at the "Analog Watch" example.

So your Draw event would look like this:

PUBLIC SUB dwgScrabble_Draw()   'don't use BEGIN and END, it is already done
        ...
        ...
END

Also, do not use WAIT statements in here if there is any slight chance 
that something elsewhere wanted to be drawn. I learned this the hard way 
:-D

Regards
Werner


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to