开发者

A treeview INSIDE OF a treeview? or how to show a list inside of a treeview

开发者 https://www.devze.com 2023-02-04 10:25 出处:网络
I have a treeview that lists the properties of an object.One of those properties is a list of Tags (strings) that can be a list of zero to whatever number of items.So you could tag a song with \"Jazz\

I have a treeview that lists the properties of an object. One of those properties is a list of Tags (strings) that can be a list of zero to whatever number of items. So you could tag a song with "Jazz" and "Favourite" and "Chillout" or whatever. At the moment I have these implemented as just a single string wit开发者_开发技巧h commas separating each tag but I'd like a more intuitive user interface. All of the other properties are shown in a 2 column treeview where the first column is the property name and the second column is the property value.

It thought one way to do this would be to place another treeview inside the second column in the tags row where users can click a row to edit/delete it or there's be a "Add new tag..." row that lets them add new tags.

How could I possibly do this? Alternatively, any different GUI suggestions?


You cannot put widgets (GtkWidget) inside a column of a treeview. But you can pack several cells (GtkCellRendenderer) into a single column. A cell renderer is kind of like a lightweight widget. It can of course be subclassed so you can write your own if nothing else fits your needs.

0

精彩评论

暂无评论...
验证码 换一张
取 消