Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图弄清楚如何以编程方式更新 NSTextField 。
我已经弄清楚如何从 Python 获取文本字段的当前值:
myVar = objc.IBOutlet() .... self.myVar.stringValue()
如何从 Python 端设置 myVar 的值并更新 GUI?我想要某种双向绑定(例如 Flex 中的 {myVAR} )。
谢谢!
如何从 Python 端设置 myVar 的值并更新 GUI?
你为什么想要?笔尖加载器将其设置为控件;如果设置变量,您将失去控制。
要设置控件的值,请向其发送setStringValue_(或类似的)消息。
setStringValue_