Hanspeter Roth wrote:


What are [clock clicks]? Time since the OS booted or the program started?

I used clicks in error. Sorry about that. clock clicks will return the highest precision slice of time that your system supports, which will vary. [clock seconds] is the one you want. Sorry for the confusion.



[clock seconds] is time in seconds since the epoch. The important thing is that it is incremented by one every second, so we can use a delta (difference in the number returned right now, versus the value in a variable which was set the last time a widget was acted upon).


This value is in seconds, so if you calculate your timeout in seconds...

set epoch [ clock seconds ]

...

if { [expr [clock seconds] - $epoch] > 300} {
        puts "\ntimeout Exceeded!\n"
        exit
}



I'd say "using" means occurrence of key-events or mouse-clicks.
Can bindings be applied to toplevels and dialogs without disturbing
the bindings of the elements (buttons, entries, ...) ?

-Hanspeter

So long as they don't conflict you should be ok. Be sure to limit the binding to something very simple, such as:


bind all <Motion> +{ set epoch [clock seconds] }


(bind all) applies the binding to all widgets in the application. It is important to be sure that you don't squash any other bindings though, as you mentioned. Thus the "+" before the script portion of the directive. This causes the binding to be appended to any other bindings for any given widget.



You'll want to double-check the docs for the particular version of tclsh/wish that you are using to be sure that the directives I've used above are valid under your version.



Good luck,


Mike





-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
vtcl-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/vtcl-user





-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
vtcl-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/vtcl-user

Reply via email to