RE: Handling multiple selections in a Gtk::TreeView

Have you read the Gtk Treeview tutorial? It's written for the C
interface but it clearly explains all the concepts of a treeview. You
can find it on



-----Original Message-----
From: Matthias [mailto:matthias digitalraid com] 
Sent: Friday, November 26, 2004 00:03
To: gtkmm-list gnome org
Subject: Re: Handling multiple selections in a Gtk::TreeView

On Thursday 25 November 2004 23:13, Murray Cumming wrote:

> This is mentioned in the book, by the way: 

I have read that of course :) It is lacking important information, e.g.:

1) Is it sufficient to call selected_foreach once to bind the callback
or do I 
have to call it whenever I want to work on the selection?

2) When exactly is the callback function called and how I can get the
rows in order to work on them?

For example it doesn't mention Gtk::TreeSelection::get_selected_rows and

ListHandle_Path, and how to use them and when.

> It's called once for each row that is selected. It is synchronous, 
> meaning that it only returns when it has finished calling your 
> callback.

So I have to call selected_foreach in my on_selection_changed handler?

> This is documented:  

Along with your further explanation, I think I've now understood it, but

honestly, from that description alone I didn't understand the concept.

> > 2) What is a ListHandle_Path and how do I use it?

I was more referring to the "path" part than the "list" part. Maybe I
have been more precise on that (see next paragraph).

> > 3) What is a slot, and what is a path?
> It is a libsigc++ callback object: 

Thanks, I didn't notice the appendix.

> "A Gtk::TreeModel::Path is essentially a potential node. It is a 
> location on a model that may or may not actually correspond to a node 
> on a specific model."

*confused* And what is it used for?

> Hopefully it makes sense now.

I'll give it a try. If I still can't get it to work I guess I have to
bug you 
again. :D
Maybe, to give at least -some- constructivce criticism, you should
all those links you just posted in the documentation as well. In
whenever a concept is introduced which requires knowledge of further
(like using sigc signals), there should be some reference, or else the
might get confused. At least I was.

Best regards,
gtkmm-list mailing list
gtkmm-list gnome org

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