有没有办法在MAC OS上进行开发时拖动堆栈窗口而不是窗口顶部的栏?如果我看不到顶部栏并尝试拖动到堆栈窗口中间的某个位置,它会激活该组,对象等。我唯一的成功就是使用'大小和位置&#39 ;在堆栈属性窗口中。 提前谢谢......
答案 0 :(得分:0)
如果您在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
我从我的一个项目中复制这个脚本。实际上,您可能不需要整个脚本,您可能认为它有点冗长,但有时对菜单栏进行校正可能会有用。