Re: [gtkmm] Treeview selection



(please use reply to all when replying to a mailing list)


On Sun, 2003-08-10 at 21:59, jerome buchler wrote:
> Well in fact the callback is working well... but my question was, how to 
> retrieve
> the name of the selected item of the treeview, in the callback function ?

Aaah, okay. By the name I assume you mean the contents of one of the
model columns?

Now, assuming this is a single-selection TreeView, you simply call
Gtk::TreeView::Selection::get_selected() which returns a
Gtk::TreeModel::iterator pointing at the row that was selected, then you
can get the column contents from that, as in (*iter)[column]

If it's a multiple-selection TreeView, get_selected_items() will give
you a list of iterators to all the selected items, which you can do with
as you will.
-- 
Matthew Walton <matthew alledora co uk>




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