For Programmers: Free Programming Magazines  


Home > Archive > Tcl > January 2006 > Create your own event, is it possible ??









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Create your own event, is it possible ??
RV

2006-01-25, 7:15 pm

Hello,

I would to create my own event, not an based on an user, keyboard or
system event, but on a variable for example :

CreateEvent "ATooBig"
if {A>100} { RaiseEvent "ATooBig"} as we can find in Visual Basic

and then
use this event anywhere to launch a function with bind or something
like that and have :

bind << ATooBig >> {
instruction bloc
}

bs

2006-01-25, 7:15 pm

Tcl has virtual events you can use

http://wiki.tcl.tk/event

see [event add]

Bryan Oakley

2006-01-25, 7:15 pm

RV wrote:
> Hello,
>
> I would to create my own event, not an based on an user, keyboard or
> system event, but on a variable for example :
>
> CreateEvent "ATooBig"
> if {A>100} { RaiseEvent "ATooBig"} as we can find in Visual Basic
>
> and then
> use this event anywhere to launch a function with bind or something
> like that and have :
>
> bind << ATooBig >> {
> instruction bloc
> }
>


You can bind widgets to virtual events, associate virtual events with
real events, and you can generate virtual events. However, to generate a
virtual event you must give it an existing window as its target.

Does that answer your question? Basically, to use a custom event you
need a widget.
RV

2006-01-26, 3:59 am

thank you,

"Variable trace" seems to be completely what I sought and even much
more.

TCL is very a powerful langage.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com