我有一个NSWindow,我在上面申请:
window.styleMask = window.styleMask | NSFullSizeContentViewWindowMask
window.titleVisibility = NSWindowTitleVisibility.Hidden;
window.titlebarAppearsTransparent = true;
Run Code Online (Sandbox Code Playgroud)
然后我在标题栏后面添加一个NSView来模拟一个更大的.现在它看起来像这样:

我希望能够通过拖动浅蓝色视图来移动窗口.我已经尝试子类化NSView并使用以下代码始终为mouseDownCanMoveWindow返回true:
class LSViewD: NSView {
override var mouseDownCanMoveWindow:Bool {
get {
return true
}
}
}
Run Code Online (Sandbox Code Playgroud)
这没用.经过一些谷歌搜索后,我在GitHub上找到了这个INAppStoreWindow.但它不支持超过10.9的OS X版本,所以它对我来说完全没用.
EDIT1
这就是它在Interface Builder中的外观.

如何通过拖动此NSView来移动窗口?
如何在不按Enter/return的情况下从控制台读取单个字符?
在红宝石中我会使用:
require 'io/console'
input = STDIN.getch
Run Code Online (Sandbox Code Playgroud) 我目前正处于学习如何使用 LLVM 的阶段。我正在尝试通过 编译以下文件llc struct-method.ll -o struct-method。
结构体方法.ll
; ModuleID = 'struct-method.ll'
@.formatstring = private unnamed_addr constant [13 x i8] c"%c\0A%ld\0A%lld\0A\00"
%box = type { i8, i32, i64 }
declare i32 @printf(i8* noalias nocapture, ...)
define i32 @set_prop_32(%box* %object, i32 %value) {
entry:
%0 = getelementptr inbounds %box, %box* %object, i64 0, i64 1
%1 = load i32, i32* %0
ret i32 %1
}
define i32 @main() {
alloca:
%mybox = alloca %box
br label %entry
entry:
%format …Run Code Online (Sandbox Code Playgroud)