[Gambas-user] Send an Event...?

GMail adamnt42 at ...626...
Sun Oct 30 01:08:22 CEST 2011


On Sat, 2011-10-29 at 10:55 -0700, J_Mischk3 wrote:

> Is it possible to send an Event to another Control?

No. Because you don't "send" events, you just raise and handle them.  So
a class can raise any event it wants to, other classes can handle events
(if they want to).

> Example:
> 
> Pushin a button will send an event to a textarea, so it can do some
> operation.

Translated:  "The button control raises the event "Click" when the mouse
button is clicked on it. Can a textarea control observe and handle the
button's Click event?"
The literal answer is "no" because the native textarea control does not
observe events from some "unheard-of" button.  However, you can create
your own textarea based control  that will observe such events and can
contain code to handle them.

> Is it possible to define own events?

Most assuredly yes.  But you have to do so in the class that will raise
them.

I have attached a little project that demonstrates the above.
By the way, this is all explained in the help under the topic "Gambas
Object Model" in section 2.

regards
Bruce



> Best regards 
> 
> Juergen, who like your gambas every time a little bit more.
> It's a great work!!!

It sure is. I like it a lot!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Events-0.0.1.tar.gz
Type: application/x-compressed-tar
Size: 5007 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20111030/f7efb235/attachment.bin>


More information about the User mailing list