Hi Andy,
thanks for this!
Cheers Frank
Am 12.07.2009 um 00:16 schrieb Andy Chambers:
On Sat, Jul 11, 2009 at 9:33 PM, Kenneth Tiltonkentilton@gmail.com wrote:
Andy,
Please search on :motionnotify. I see an example in the gears demo. I know that is OpenGL but I am pretty sure all the code you see in there in re event handling is generic to Tk, nothing about OpenGl.
The nise thing about Tk via FFI is the control one gets from low-level access to the event stream. There are rare cases where I feel Tk did not expose enough via an API -- I remember vaguely something about key events, forcing me to code up a virtual event handler -- but as a rule the Tcl/Tk world is your oyster with an FFI based interface.
Cool I've got something working. Just posting it to the list in-case anyone else wants to use it...
The usage would be...
(defmd my-window (window) :kids (c? (the-kids (mk-stack (:packing (c?pack-self)) (mk-label :text "hi" :on-hover (lambda () (trc "hovering...")))))))
The on-hover function only gets called after the mouse has been sitting in the widget for 1 1/2 seconds. The attached patch puts an on-hover slot on the widget class so you should be able to apply to any widget in your hierarchy.
-- Andy <hover.patch>_______________________________________________ cells-devel site list cells-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/cells-devel
-- Frank Goenninger
Cell: +49 175 4321058 E-Mail: frgo@me.com