首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Livecode命令击键

Livecode命令击键
EN

Stack Overflow用户
提问于 2014-09-20 23:05:45
回答 1查看 108关注 0票数 2

有没有一种方法可以在MAC OS上开发时拖动堆栈窗口,而不是在窗口顶部的栏上?如果我看不到顶部栏并试图拖动到堆栈窗口中间的某个位置,它会激活该组、对象等。我唯一成功的方法是使用堆栈属性窗口中的“大小和位置”。先谢谢你...

EN

回答 1

Stack Overflow用户

发布于 2014-09-21 04:49:22

如果您在IDE中工作,则可以键入command-M以显示消息框,并在消息框中键入以下代码:

代码语言:javascript
复制
set the loc of this stack to the screenLoc

这通常会将窗口的顶部移动到屏幕的可见部分。您还可以使用

代码语言:javascript
复制
set the top of this stack to 100

这会将标题栏向下移动到屏幕顶部以下的100个像素。

如果要移动没有标题栏的堆栈窗口,可以使用以下脚本:

代码语言:javascript
复制
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

我从我的一个项目中复制了这个脚本。实际上,您可能不需要整个脚本,并且您可能认为它有点冗长,但有时对菜单栏进行更正可能会很有用。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25950123

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档