[Gambas-user] Keeping track of opened form instances

Tobias Boege taboege at ...626...
Thu Jul 4 10:14:16 CEST 2013


On Thu, 04 Jul 2013, Bruce wrote:
> Hi folks,
> 
> I have a form ("FSummary") that basically opens a variable number of
> other forms. This action is controlled by the user.
> 
> Each other form is an instance of a single form/class, say "FDetail".
> Each and any of these could be closed by the user at any time.  Also,
> when the FSummary form is closed, any remaining FDetail forms need to be
> automatically closed.
> 
> I have tried a few times to achieve this using arrays of Forms and
> arrays of window handles etc. but I am not really happy with the
> results.
> 
> How have others approached this issue?
> 
> tia
> Bruce
> 

Hmm. Normally there is something in the gb component to help you with
introspection problems like this. But this time I haven't found any.

I implemented this array method in a sample project and it seems to behave
quite well. I use an Observer to silently duplicate the events from the
children forms and manipulate an array in the parent form accordingly.

Even if not a new idea, I hope it helps.

Regards,
Tobi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: autoclose_children-0.0.1.tar.gz
Type: application/octet-stream
Size: 5373 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20130704/64c71c00/attachment.obj>


More information about the User mailing list