hi Thomas,
sorry about being so slow with responding (surely much less responsive than tcl/tk-based gui:)
Thomas Grill wrote:
am 16.10.2002 15:21 Uhr schrieb Krzysztof Czaja unter czaja@chopin.edu.pl:
...
actually I need only mouse _position_ polling (or, strictly speaking, sampling), which is available by calling winfo pointerxy.
Hmmm, i don't understand the advantage of polling compared to position events. If you want to poll from TCL/TK you would have to trigger a TK function and get the values via a bound message (but you know that). So using the mouse events, cache the position and do the polling (if necessary) internally seems more convenient to me.
well, this is just how MouseState works -- by default, it has to be banged in order to report mouse position (ok, this should be called sampling, not polling). Moreover, winfo pointerxy seems to be the only way of just getting the current mouse position reliably, i.e. to cover entire screen (as long as any of Pd windows is focused), and not being hampered by anybody imposing weird hooks upon pd.tk...
About the main subject of this thread -- I really like Guenter's idea of defining an abstract middle layer (or just a simple, toolkit-independent api)...
Krzysztof