如何对GtkTreeModelFilter进行排序?

时间:2017-11-21 16:47:28

标签: sorting gtk gtktreeview

我有一个GtkListStore,其中包含GtkTreeModelFilter,以过滤掉某些行。然后我将此过滤器放在GtkTreeView内。

这导致我的GtkTreeView无法排序,因为GtkTreeModelFilter未实现GtkTreeSortable

如何制作,以便我仍然可以对GtkTreeView中的行进行排序?

1 个答案:

答案 0 :(得分:2)

最简单的方法是在GtkTreeModelSort周围包裹GtkTreeModelFilter。然后将此包装器添加到GtkTreeView

总之,GtkListStoreGtkTreeModelFilter内的GtkTreeModelSortGtkTreeView "com.sksamuel.elastic4s" %% "elastic4s-core" % Versions.elastic4s excludeAll ExclusionRule(organization = "org.apache.logging.log4j"), // for the http client "com.sksamuel.elastic4s" %% "elastic4s-http" % Versions.elastic4s excludeAll ExclusionRule(organization = "org.apache.logging.log4j"), // for the tcp client "com.sksamuel.elastic4s" %% "elastic4s-tcp" % Versions.elastic4s excludeAll ExclusionRule(organization = "org.apache.logging.log4j"), // testing "com.sksamuel.elastic4s" %% "elastic4s-testkit" % Versions.elastic4s % "test", "com.sksamuel.elastic4s" %% "elastic4s-embedded" % Versions.elastic4s % "test", "org.apache.logging.log4j" % "log4j-core" % "2.8.2" % "test", "org.apache.logging.log4j" % "log4j-api" % "2.8.2" % "test",

相关问题