[Gambas-user] Drawing Areas, painting on them, and printing the results...

Jussi Lahtinen jussi.lahtinen at ...626...
Wed Sep 3 00:22:20 CEST 2014


> I guess it is the need to use the draw event in order to do anything
> with the drawing area that had me spun. I think in terms of methods,
> properties and events, but I do not think in terms of events being the
> very thing that actually does the work.
>

Draw event is called every time drawingarea needs to be drawn. Thus it is
where you put the drawing commands.

But you can change this behavior by setting Cached property to True.
Then you start painting by determining painting device (Gambas cannot know
where to draw, if you are not in specific drawing event)
Paint.Begin(hNameOfPaintingDevice) and end with Paint.End.
See the documentation.




> I'm thinking of it now in terms of Macros, using the Object.Call(me,
> $sFunctionName) treats the code in $sFunctionName like a Macro, (am I on
> the right track?) Flexible & powerful yes. Intuitive in it's usage, not
> so much.
>

This only enables you to use string value to call a function. There are
many alternatives for this.




> One of the things that really confused me was the paint.reset command
> telling me it had no device.... ummm... no "device"? To me a device is a
> piece of hardware, a printer, a modem, a screen, keyboard, mouse,
> soundcard, NIC, Com port etc.


In Unix/Linux device has bit broader meaning, see example /dev/null or
/dev/random. Not all devices are physical devices.




> BTW, how does reset differ from clear?
>

http://gambaswiki.org/wiki/comp/gb.qt4/drawingarea/clear
http://gambaswiki.org/wiki/comp/gb.qt4/paint/reset



Jussi



More information about the User mailing list