Cocoa:创建具有可变数量界面元素的窗口

发布于 2024-08-28 17:15:39 字数 402 浏览 4 评论 0原文

我有一个窗口,其中包含未知数量的文本字段,由远程服务器的内容决定。

从高层次来说,我应该如何处理这个问题?创建 自定义视图 或创建一个带有支持 NSWindowController 的空窗口,然后在窗口打开时向其中添加内容?

我已经看过 O'Reilly Cocoa 书中的示例,它们有效地创建了自定义 NSView。 8年后,这是否是正确的做法?

I've a window that will have an unknown amount of text fields, determined by the content of a remote server.

In high level terms, how should I go about this? Create a custom view or create an empty window with a backing NSWindowController and then add stuff to it when the window is opened?

I've seen the examples on the O'Reilly Cocoa book and those effectively create a custom NSView. Is this the right way to do it, 8 year later?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夕色琉璃 2024-09-04 17:15:39

你可能想要一个 NSMatrix。 NSMatrix 允许您创建任意大的单元格网格。

根据您的具体需求,还可以选择表格、大纲、浏览器等。

You probably want an NSMatrix. A NSMatrix allows you to create an arbitrarily large grid of cells.

Tables, outlines, browser etc are also options depending on your specific needs.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文