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:
> http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/ch08s04.html

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 selected 
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:
> http://www.gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGtk_1_1TreeSel
>ection.html#a16

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?
>
> http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/ch03s05.html

I was more referring to the "path" part than the "list" part. Maybe I should 
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:
> http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/ch03s03.html

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 cross-link 
all those links you just posted in the documentation as well. In general, 
whenever a concept is introduced which requires knowledge of further details 
(like using sigc signals), there should be some reference, or else the reader 
might get confused. At least I was.

Best regards,
Matthias



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