与父母的孩子沟通

发布于 2024-12-09 22:41:32 字数 315 浏览 1 评论 0原文

我正在尝试编写一个具有以下结构的 GUI(仅相关部分):

窗口->垂直框-> H盒->框架:输入

               -> ScrolledWindow -> TreeView -> ListStore: Output 

一旦接收到输入,我们就会计算出一个列表,即输出。如何将此列表发送到 ListStore 以便显示它?我是否需要在每个元素中拖动父元素的引用?或者有更简单的方法吗?

I'm trying to write a GUI with the following structure (only relevant parts):


Window -> VBox -> HBox -> Frame: Input

               -> ScrolledWindow -> TreeView -> ListStore: Output 

As soon as the input is received, a list will we computed that is the output. How do I send this list to the ListStore so that it will be displayed? Do I need to drag references of the parent element along in every element? Or is there an easier way?

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

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

发布评论

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

评论(1

可爱咩 2024-12-16 22:41:32

您可以保留输入和输出的引用,然后执行以下操作:

  • 将一个方法绑定到您的输入,该方法将在更新或验证时调用,
  • 在此方法中,执行所需的处理,
  • 在此方法的末尾,更新您的输出,直接使用其引用及其内部函数(配置或其他)。

也许有更好的方法来做到这一点(使用 Var 类?),但这就是我要做的。

You can just keep references of your input and your output, then do the following:

  • bind a method to your input, that will be called on update or validation,
  • in this method, do the treatment needed,
  • at the end of this method, update your output, directly using its reference and its internal functions (configure or else).

There maybe a better way to do it (using Var classes?) but that's how I would do it.

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