Gtk.ListStore 中的虚拟模式?

发布于 2024-08-28 01:16:14 字数 89 浏览 3 评论 0原文

我正在 Gtk.ListStore 中寻找一个像 Winforms 中的 ListView.VirtualMode 一样工作的功能。

有这样的事吗?

I'm looking for a feature within the Gtk.ListStore that working like the ListView.VirtualMode in Winforms.

Is there something like that?

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

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

发布评论

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

评论(1

音栖息无 2024-09-04 01:16:14

Gtk# 的 ListStore 是一种集合类型,类似于 .NET 中的 ArrayList。它不是一个视觉小部件。它代表了模型-视图-控制器设计模式中 Gtk# 的 TreeStore 模型的简化版本。

另一方面,Winform 的ListView 是一个可视控件。它代表模型-视图-控制器设计模式中的视图组件。

您正在将苹果与橙子进行比较。

Gtk# 的可视化小部件在功能上与 Winforms ListView 或 TreeView 类似,是 Gtk" 的 TreeView 。Gtk# TreeView 的 Model 属性可以分配一个实现 Gtk# TreeModel 接口的集合。现在 Gtk#的 ListStore 实现了 TreeModel 接口,因此可以将其分配给 Gtk# TreeView 的 Model 属性,这就是 Gtk# 中数据绑定的工作方式。

Gtk# 数据绑定范例有点难以掌握,但一旦掌握它就会非常强大。

Gtk#'s ListStore is a collection type like the ArrayList in .NET. Its not a visual widget. It represent the simplified version of the Gtk#'s TreeStore Model in the Model-View-Controller design pattern.

The Winform's ListView on the other hand is a visual control. It represents the View component in the Model-View-Controller design pattern.

You are comparing apples with oranges.

Gtk#'s visual widget that would be similar in functionality to Winforms ListView or TreeView would be a Gtk"'s TreeView . The Model property of a Gtk# TreeView can be assigned a collection that implements the Gtk# TreeModel interface. Now Gtk#'s ListStore implements the TreeModel interface therefore it can be assigned to the Gtk# TreeView's Model property. Thats how databinding works in Gtk#.

Gtk# databinding paradigm is a little hard to grasp but is very powerful once you get a hold on it.

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