[Gambas-user] Really dumb question about dialog forms

Kadaitcha Man nospam.nospam.nospam at ...626...
Fri Dec 11 10:04:05 CET 2009


2009/12/11 Doriano Blengino <doriano.blengino at ...1909...>:
> Kadaitcha Man ha scritto:
>>> If I create a new form with the dialog support it gets this code:
>>> Public Sub Run() As Boolean
>>>
>>
>>> If I had a textbox on the form and wanted to return its contents, what would
>>> be the change in syntax required?
>>>
>>
>> None whatsoever.
>>
>> Create a public variable in a common module. Set the variable from
>> within your modal form and read it from somewhere else, such as the
>> code that called the form, for example.
>>
> ...with good restful peace for good programming tecniques...
>
> I don't know what is this issue of "modal forms support" in gambas3 but,
> if things are as you have put them, then it is awful. Anyway, to create
> variables in yet another module, so ones have three files to do a single
> thing, is just the best way to mess up everything.

First up, one generally does not write a GUI application to do one
single thing so creating a public variable in some module should not
be a major issue.

Second, someone else will have to tell you if there is a method other
than what I describe; I looked for days and found nothing. I tried for
many hours and failed to get it to work. When the Close() method is
called by the modal window, the window instantly commits Harakiri and
invalidates itself, so even if you instantiate a form inside a form
variable, the window is instantly dereferenced the moment Close()
executes.

Gambas should not do that, IMO. The form should stay accessible to
programmer via the variable until the programmer destroys it, or until
the method that created the form variable terminates.

I know it isn't kosher OO behavior, but what do you want from Gambas?
Is having kosher OO more important than being able to choose not to
have to learn C++, Pascal, or Java?




More information about the User mailing list