Re: Finding the column index for a Gtk::TreeViewColumn from a Gtk::TreeView



On Sun, 2006-04-23 at 13:12 -0400, Paul Davis wrote:
> On Fri, 2006-04-21 at 20:15 +0100, Alex Buell wrote:
> > Does anyone knows how I can find the column index for a given
> > Gtk::TreeViewColumn from a Gtk::TreeView object? Thanks!
> 
> if you are talking about doing this from (for example) a button event
> handler then suprisingly enough, you can't. the tutorial on the treeview
> mentions this deficiency, which i find hard to believe. i use the
> solution of using the set_data() method to store a column index at
> construction time and get_data() to fetch it in the event handler. it
> seems crude and i think that GTK+ should do better on this one.

I guess you could iterate through the TreeViewColumns and do a pointer
comparison, to discover the view model index.

-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]