Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cocoa 在视图中嵌入外部应用程序_Cocoa_Sublimetext2 - Fatal编程技术网

Cocoa 在视图中嵌入外部应用程序

Cocoa 在视图中嵌入外部应用程序,cocoa,sublimetext2,Cocoa,Sublimetext2,我希望在Mac OS X下有一个应用程序,使我能够在同一个全屏窗口中有Sublime Text 2和终端(用于显示测试结果、运行grunt任务等)。我找不到具有这种行为的应用程序,我想用cocoa split view自己复制它。 我想知道这是否可能,如果可能,我如何开始实施它 谢谢您无法从其他两个应用程序创建新的应用程序。这行不通。但是,您可以使用applescript轻松定位这些窗口 例如,我将使用Safari和Terminal作为我的两个应用程序。打开它们并按您希望的方式将其放置在屏幕上。

我希望在Mac OS X下有一个应用程序,使我能够在同一个全屏窗口中有Sublime Text 2和终端(用于显示测试结果、运行grunt任务等)。我找不到具有这种行为的应用程序,我想用cocoa split view自己复制它。 我想知道这是否可能,如果可能,我如何开始实施它


谢谢

您无法从其他两个应用程序创建新的应用程序。这行不通。但是,您可以使用applescript轻松定位这些窗口

例如,我将使用Safari和Terminal作为我的两个应用程序。打开它们并按您希望的方式将其放置在屏幕上。我打开每个大窗户,并排放置。然后我运行这个applescript来获取它们的窗口大小和位置属性

tell application "System Events"
    tell process "Safari"
        set safariSize to size of window 1
        set safariPosition to position of window 1
    end tell
    tell process "Terminal"
        set terminalSize to size of window 1
        set terminalPosition to position of window 1
    end tell
end tell
return {safariSize, safariPosition, terminalSize, terminalPosition}
然后,我将该脚本的结果复制/粘贴到该脚本中的“theValues”变量中。现在,只要我想,我就可以运行这个脚本来重新创建那些窗口位置

set theValues to {{1001, 1025}, {0, 22}, {613, 1024}, {1003, 22}}

tell application "Safari" to activate
tell application "Terminal" to activate

tell application "System Events"
    tell process "Safari"
        set size of window 1 to item 1 of theValues
        set position of window 1 to item 2 of theValues
    end tell
    tell process "Terminal"
        set size of window 1 to item 3 of theValues
        set position of window 1 to item 4 of theValues
    end tell
end tell

我希望这有帮助。祝您好运。

您无法从其他两个应用程序创建新应用程序。这行不通。但是,您可以使用applescript轻松定位这些窗口

例如,我将使用Safari和Terminal作为我的两个应用程序。打开它们并按您希望的方式将其放置在屏幕上。我打开每个大窗户,并排放置。然后我运行这个applescript来获取它们的窗口大小和位置属性

tell application "System Events"
    tell process "Safari"
        set safariSize to size of window 1
        set safariPosition to position of window 1
    end tell
    tell process "Terminal"
        set terminalSize to size of window 1
        set terminalPosition to position of window 1
    end tell
end tell
return {safariSize, safariPosition, terminalSize, terminalPosition}
然后,我将该脚本的结果复制/粘贴到该脚本中的“theValues”变量中。现在,只要我想,我就可以运行这个脚本来重新创建那些窗口位置

set theValues to {{1001, 1025}, {0, 22}, {613, 1024}, {1003, 22}}

tell application "Safari" to activate
tell application "Terminal" to activate

tell application "System Events"
    tell process "Safari"
        set size of window 1 to item 1 of theValues
        set position of window 1 to item 2 of theValues
    end tell
    tell process "Terminal"
        set size of window 1 to item 3 of theValues
        set position of window 1 to item 4 of theValues
    end tell
end tell

我希望这有帮助。祝你好运。

谢谢,不幸的是,这在全屏上不起作用,这正是我想要做的。我已经有了非全屏定位的解决方案:)正确,它不会全屏显示,但您将无法做到这一点。这是您在不使用这两种应用程序的功能编写自己的应用程序的情况下所能达到的最高水平。我认为你不想这么做,所以就用这个近似值生活吧。听起来OP确实想这么做,所以我建议他看看Ace、Cloud9和GateOne。。。您可以使用全终端构建自己的IDE,然后以全屏模式运行浏览器窗口,以最大限度地提高房地产价值。您还可以从云实例在ChromeBook上运行这些。就我个人而言,我更喜欢远程运行一些全屏、分屏的tmux会话,其中一个窗格中有一个vim/emacs强大的编辑器……谢谢,不幸的是,这在全屏上不起作用,这正是我想要做的。我已经有了非全屏定位的解决方案:)正确,它不会全屏显示,但您将无法做到这一点。这是您在不使用这两种应用程序的功能编写自己的应用程序的情况下所能达到的最高水平。我认为你不想这么做,所以就用这个近似值生活吧。听起来OP确实想这么做,所以我建议他看看Ace、Cloud9和GateOne。。。您可以使用全终端构建自己的IDE,然后以全屏模式运行浏览器窗口,以最大限度地提高房地产价值。您还可以从云实例在ChromeBook上运行这些。就我个人而言,我更喜欢远程运行一些全屏、分屏的tmux会话,其中一个窗格中有一个vim/emacs强大的编辑器。。。