Autohide Stack based on mouse coordinates?
Posted: Tue Jun 05, 2007 4:16 am
Greetings,
Trying to autohide a stack that is merely a menubar of selected tools for a user to use. I'm trying to autohide it when the mouse goes below the bar, if a menu is not presently open.
right now, I'm using "on mouseLeave" to detect when the mouse has left and no menu is open. Then I'm using "send subMouseLoop to me in 1 milliseconds" to test if the mouse location. If it's < 1, then the user has the mouse at the top of the screen. but I'm running into all sorts of problems and I'm not sure why or what to do to resolve them at the moment.
Do I need to also put "send subMouseLoop to me in 1 milliseconds" into every event handler in order to get back to my mouse checking loop? Or am I creating a horrible mess here? Is there a better way to setup a global loop of some sort for what I'm in need of?
Thank in advance,
-Garrett
Trying to autohide a stack that is merely a menubar of selected tools for a user to use. I'm trying to autohide it when the mouse goes below the bar, if a menu is not presently open.
right now, I'm using "on mouseLeave" to detect when the mouse has left and no menu is open. Then I'm using "send subMouseLoop to me in 1 milliseconds" to test if the mouse location. If it's < 1, then the user has the mouse at the top of the screen. but I'm running into all sorts of problems and I'm not sure why or what to do to resolve them at the moment.
Code: Select all
on openStack
send subMouseLoop to me in 1 milliseconds
end openStack
Code: Select all
on mouseLeave
if field "SettingsAutoHide" is "yes" and field "TestField" is not "Mouse OUT" then
put "Mouse OUT" into field "TestField"
set the top of me to -22
end if
send subMouseLoop to me in 1 milliseconds
end mouseLeave
Code: Select all
on subMouseLoop
send subMouseLoop to me in 1 milliseconds
if field "SettingsAutoHide" is "yes" then
put the mouseLoc into field "DateTimeField"
--set the itemdel to ","
put item 2 of the mouseLoc into varMouseV
if varMouseV < 1 and field "TestField" is "Mouse OUT" then
set the top of me to 0
put "Mouse in" into field "TestField"
end if
end if
end subMouseLoop
Thank in advance,
-Garrett