[Gambas-devel] bug

Benoit Minisini gambas at ...1...
Fri Jul 1 17:56:22 CEST 2005


On Friday 24 June 2005 20:38, rospolosco wrote:
> Hello Benoit.
>
> I found this bug. I made a form with a button and a drawing area.
>
> When I click the button I would change the background color of
> the drawing area and draw a white rectangle. But:
>
> on first button click only background color changes;
>
> on second click I finally see the rectangle.
>
> To work around this little problem I added this line
> to the code:
>
> WAIT 0
>
> and now on first button click everything goes well.
>
> I've attached the buggy code. Just uncomment the
> WAIT 0 line to work around the bug.
> This is the code I run with Gambas 1.0.6.
> The problem exists in 1.0.6 and 1.9.9.
>
> My system:
>
> OS: GNU/linux Mandrake 10.1
> kernel: 2.4.31
> CPU: Athlon 900 Mhz
> Ram: 192 Mb
> Gambas 1.0.6
>
> Thanks for Gambas,
>
> Stefano
>

Actually, you have set DrawingArea.Cached to FALSE, so your drawing code must 
be put in the 'Draw' event handler. Otherwise, the behaviour is hard to 
predict.

You should not rely on the background and foreground property to draw inside 
the DrawingArea. Set them with Draw.Foreground and Draw.Background directly.

But I admit this is logical, so in the future, the Background and Foreground 
DrawingArea properties may be automatically transmitted to the Draw class.

Last, you should not use the Clear method when Cached is set to FALSE. It does 
nothing!

> P.S.
>
> In 1.9.9 the autocompletation in .Perm. inside
> a WITH  END WITH construct doesn't work.
> I mean:
>
> WITH Stat(a file)
>
>     .Perm.(no_auto_completation user-group-other)
>
> END WITH

OK, this bug will be fixed in the next version.

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the Devel mailing list