开发者

Gtk# TreeView set a single cell to have a different renderer?

开发者 https://www.devze.com 2023-01-02 03:00 出处:网络
OK this is probably insane, but I want to be able to have a check box at the very top of every row in my tree view. This box will \"disable\" or \"enable\" the ability to use the column. Oh I think it

OK this is probably insane, but I want to be able to have a check box at the very top of every row in my tree view. This box will "disable" or "enable" the ability to use the column. Oh I think it should be mentioned that I'm using a ListStore and am using C#, mono, GTK#. However, ill take anything and try to figure i开发者_JAVA百科t out.

I'll even accept a way to make two views where the columns line up.

So, possible? or just insane?


I know it's an old post, but the answer might help someone else.

It's possible and quite simple to be honest. You have to add your custom widget (for instance a Gtk.ToggleButton or your own implementation of a checkbox) to the Gtk.TreeViewColumn.Widget property.

Job done! :)

You might find also quite useful a Gtk.TreeViewColumn.Clicked event to subscribe to.

Hope it helps.

0

精彩评论

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