Widgets to list files with gtk

痞子三分冷 提交于 2019-12-25 11:01:07

问题


I am creating an application which is going to list a bunch of files. I would like to list files like fileroller, but I don't know how. I guess I need to create a 2xn (name, size) grid, but I don't know how to make entries appear light->dark->light per line, and how to create a "fat" bar above it. Can anyone tell me what sort of widgets I need to combine to create something like that?


回答1:


You probably want a GtkTreeView with a GtkListStore, that should give you everything you need. If you've never used it, you should start with reading the Tree and List Widget Overview and be prepared to do some googling even afterwards -- it's the most complex widget in the toolkit.

The treeview can have a header, and the alternating light/dark rows are typically achieved with gtk_tree_view_set_rules_hint (treeview, TRUE) -- but please read the documentation, 'rules hint' is a semantic thing not specifically a visual setting.



来源:https://stackoverflow.com/questions/21367427/widgets-to-list-files-with-gtk

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!