Re: [Plib-users] enter / leave events for puButtons ?
Brought to you by:
sjbaker
From: Steve B. <sjb...@ai...> - 2001-09-09 15:12:45
|
Sebastian Ude wrote: > Is there an easy way to invoke a callback whenever the mouse pointer enters > or leaves the area of a puButton ? PUI wasn't designed to allow that - I suppose you could cheat and in the motion callback, pass button-is-down values to PUI even when the button is really up - then in your PUI widget's callback, check whether the button is *REALLY* pressed down and only take the appropriate action when it is. That would require that you set puObject::setActiveDirn ( PU_CONTINUAL ) or something like that. > I tink of keeping track of the button positions and compare the cursor > position with the collected positions in my motion callback - but isn't > there a less difficult way ? Well, the way I suggest is still rather ugly - but I think it'll work. Try it in a simple test environment before you start to rely on it! This kind of 'mouse-over' highlighting is becoming rather popular (dunno why) - perhaps we should consider extending PUI to do it properly with a 'mouse-over' callback? ----------------------------- Steve Baker ------------------------------- Mail : <sjb...@ai...> WorkMail: <sj...@li...> URLs : http://web2.airmail.net/sjbaker1 http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net http://freeglut.sf.net http://toobular.sf.net http://lodestone.sf.net |