Hover over gadget

3 posts / 0 new
Last post
mritter0
mritter0's picture
Offline
Last seen: 1 week 6 days ago
Joined: 2014-04-21 21:15
Hover over gadget

I have started a new gadget class. This one is just a button (not buttonclass) with text.

How do I know when the mouse is hovering over the gadget? I would like to know so I can alter the border and/or text. I don't seem to be getting any GM/OM_xxx signals. Or I am looking at the wrong one?

I would have thought GM_QUERY would be the place to check, but not having any luck. Check input event for timer, check coordinates, if good then render with hover state.

xenic
xenic's picture
Offline
Last seen: 1 week 6 days ago
Joined: 2011-05-07 04:52
Re: Hover over gadget

@mritter
Since nobody has an answer to your query, I'll just point out the fact that the WIndow structure contains mouse positions (MouseX & MouseY) relative to the upper left of the window. I'm no sure how often Intuition updates the mouse position in the Window structure but I suspect it's with every Intuitick (~tenth of a second). If you set IDCMP_INTUITICKS in the window's IDCMP flags (WA_IDCMP) you should be able to use "case WMHI_INTUITICK:" to check the mouse position.

X1000 - OS 4.1FE
mritter0
mritter0's picture
Offline
Last seen: 1 week 6 days ago
Joined: 2014-04-21 21:15
Re: Hover over gadget

@xenic
Thanks. I have some old code that does what I want, but it is a totally different kind of class, so still trying to figure it out. It uses a timer event. I haven't done much since I sent my X5000 out to California for AmiWest.

Log in or register to post comments