[Gambas-user] define a startup class?

Benoit Minisini gambas at ...2...
Mon May 19 15:27:31 CEST 2003


Le Lundi 19 Mai 2003 10:48, Benoit Minisini a écrit :
>
> When you have a form named Form1 in VB, and you type Form1.Show, what
> happens in the background ? Exactly what you must do by hand in Gambas: the
> form is instanciated, and the instance is given the same name as the form.
>
> This leads to problems:
>
> 1) The newbie is confused, because class and instance of this class have
> the same name. So the newbie don't really understand what he does exactly.
>
> 2) The form is instanciated when you try to use the form class as a form
> instance. You save two lines of code and one variable at first, but when
> you want to exit the program, you must be very careful not to make a
> reference to a closed form, elsewhere this form is recreated, and your
> program does not exit ! (I had this problem many times in my VB programs)
>
> Maybe I could have the same behavior with forms on Gambas. But I think that
> the disadventages are greater than the advantages.
>
> > I'm hoping to hack the IDE to hide some of this and make some of it
> > automatic, maybe even provide an option to emulate the VB startup form
> > behavior and hide Sub Main in that case.  I know this is contrary to what
> > Benoit wants to do (make a VB like language that Linux people won't sneer
> > at too badly) but I'll probably submit the patches anyway when things are
> > working just in case.
> >
> > Rob
>
> Modifying the IDE will not help you... It is a functionnality that must be
> add to the interpreter: something like auto-instanciating class. But I
> don't even know if it is technically possible at the moment !
>
> Maybe I could add a method to the Form class: Form.ShowDialog, that will
> automatically create an instance, and open it modal. But it need support
> into the interpreter too...
>
> Regards,

And sorry for all the english mistakes. I should check my posts more carefully 
before sending them !

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




More information about the User mailing list