有没有一种方法可以在MAC OS上开发时拖动堆栈窗口,而不是在窗口顶部的栏上?如果我看不到顶部栏并试图拖动到堆栈窗口中间的某个位置,它会激活该组、对象等。我唯一成功的方法是使用堆栈属性窗口中的“大小和位置”。先谢谢你...
发布于 2014-09-21 04:49:22
如果您在IDE中工作,则可以键入command-M以显示消息框,并在消息框中键入以下代码:
set the loc of this stack to the screenLoc这通常会将窗口的顶部移动到屏幕的可见部分。您还可以使用
set the top of this stack to 100这会将标题栏向下移动到屏幕顶部以下的100个像素。
如果要移动没有标题栏的堆栈窗口,可以使用以下脚本:
on grabWindow
if the platform is "MacOS" and (the decorations of the defaultStack contains "title" or the decorations of the defaultStack is "default") then
put 22 into myMenuCorrection
else
put 0 into myMenuCorrection
end if
put "10,10,310,310" into myRect
add myMenuCorrection to item 2 of myRect
lock messages
put (trunc(the width of this window/2) - the mouseH) into difH
put (trunc(the height of this window/2) - the mouseV) into difV
repeat until the mouse is up
put the loc of this window into loc1
put the screenMouseLoc into loc2
add difH to item 1 of loc2
add (difV + myMenuCorrection) to item 2 of loc2
if loc1 is not loc2 then set the loc of this window to loc2
end repeat
unlock messages
end grabWindow
on mouseDown
grabWindow
end mouseDown我从我的一个项目中复制了这个脚本。实际上,您可能不需要整个脚本,并且您可能认为它有点冗长,但有时对菜单栏进行更正可能会很有用。
https://stackoverflow.com/questions/25950123
复制相似问题