Centering stack on current monitor
Posted: Sun Mar 15, 2015 8:38 am
Hi,
I am using the following code to toggle fullscreen. I use Ctrl-F for the toggle. I had assumed that when I toggle from fullscreen that the stack would go back to it's original position, but alas it does not. Sometime the stack is positioned so that the top part is missing and thus interaction with the stack is problematic. The workaround I have implemented just centers the stack when the user toggles out of fullscreen mode. Works great on systems with a single monitor. If my stack is showing on a second monitor, the fullscreen mode works, but toggling back and centering puts it back on the main monitor.
Is there any way I can force my stack to be positioned to the center of the second monitor?
Thanks
Bergsy
on centerMe
set the loc of this stack to the screenLoc
end centerMe
on standardPreOpen
centerMe
set the fullscreen of this stack to false
--set the fullscreenmode of this stack to "exactFit"
set the fullscreenmode of this stack to "letterbox"
end standardPreOpen
on handleCommands theKey
--if theKey is not a number then beep
if theKey = "f" or theKey = "F" then
put the fullscreen of this stack into bFullScreen
set the fullscreen of this stack to not bFullScreen
centerMe
end if
end handleCommands
on preOpenStack
standardPreOpen
end preOpenStack
on commandkeyDown theKey
handleCommands theKey
end commandkeyDown
I am using the following code to toggle fullscreen. I use Ctrl-F for the toggle. I had assumed that when I toggle from fullscreen that the stack would go back to it's original position, but alas it does not. Sometime the stack is positioned so that the top part is missing and thus interaction with the stack is problematic. The workaround I have implemented just centers the stack when the user toggles out of fullscreen mode. Works great on systems with a single monitor. If my stack is showing on a second monitor, the fullscreen mode works, but toggling back and centering puts it back on the main monitor.
Is there any way I can force my stack to be positioned to the center of the second monitor?
Thanks
Bergsy
on centerMe
set the loc of this stack to the screenLoc
end centerMe
on standardPreOpen
centerMe
set the fullscreen of this stack to false
--set the fullscreenmode of this stack to "exactFit"
set the fullscreenmode of this stack to "letterbox"
end standardPreOpen
on handleCommands theKey
--if theKey is not a number then beep
if theKey = "f" or theKey = "F" then
put the fullscreen of this stack into bFullScreen
set the fullscreen of this stack to not bFullScreen
centerMe
end if
end handleCommands
on preOpenStack
standardPreOpen
end preOpenStack
on commandkeyDown theKey
handleCommands theKey
end commandkeyDown