[Gambas-user] Karmic sqlite problem.

Benoît Minisini gambas at ...1...
Thu Nov 5 15:28:28 CET 2009


> Benoît Minisini wrote:
> >> Here is a program and it do hang when you enable me.width in form1
> >>
> >> http://old.nabble.com/file/p26203186/crash-test-0.0.1.tar.gz
> >> crash-test-0.0.1.tar.gz
> >>
> >>
> >> -----
> >> Regards R. Stormo
> >>
> >>
> >> My Gambas Community http://gambasforum.tk
> >
> > Your program is an endless loop into Form_Resize.
> >
> > Your form is inside a HBox. So changing the Width triggers a deffered
> > Resize
> > event. But as the HBox resizes the form later, the Width changed again to
> > its
> > initial value, and all the process starts again forever!
> >
> > Changing the size of the form inside its Resize event is a bad idea. What
> > did
> > you try to achieve?
> 
> It has worked for a couple of years.  strange that it just arrived then.
> You say it's a endless loop.?
> 
>  f1 = NEW Form1(HBox1)
>  f2 = NEW Form2
>  f3 = NEW Form1
> 
> Isn't F1 a new instance of the form also f3 , then it should not be a
> problem to resize it twice.
> 

Resizing a form inside its resize event is *always* a bug in the design of 
your application.

Setting the width property of a form won't raise a Resize event only if the 
new width is the same as the old width.

> The reason for the hbox is to show my customers unpayed bills every where,
> but also show it as
> tabbed as well.
> 
> If I disable f1 as well it still hangs, then there is only one that use the
> form1.

So you replace two possibilities of and endless loop by only one. But you 
still have one.

Regards,

-- 
Benoît Minisini




More information about the User mailing list