[Gambas-user] Events and attach
Benoit Minisini
gambas at ...1...
Fri Jan 13 13:01:25 CET 2006
On Thursday 12 January 2006 14:18, Marco Gusy wrote:
> another events related question :-)
>
> I'm embedding a form into another form to use it as a control. I need its
> events so I object.attach(ctl,me,"control")
> into the form.
>
> The problem is.... the ctl (the embedded form) won't execute the
> form_resize code anymore. Is there any solution?
>
> Thanks
>
> Marco
>
All events raised by an object can be processed by only one event observer. So
things are not simple.
You can create your own control by inheriting UserControl or UserContainer in
gambas 1.9.x. Examples are located in the source code of the gb.form
component.
In gambas 1.9.x, there is a class name "Watcher" that can watch a control, and
raise events when something happens on it: Move, Resize, ...
Actually, embedding a form is mainly useful just when you want to... embed a
form, and not when you want to use it exactly like a control.
Having many event observers for the same object is too complicated to do, but
maybe I could implement a way to dispatch an event to another object, by
having two event observers... I really have no real idea at the moment.
Regards,
--
Benoit Minisini
More information about the User
mailing list