Pre-set selected elements of Gtk::ListViewText



Dear list,

I have created a dialog where I prompt the user with a ListViewText,
from which he can choose multiple strings. This works fine.

I would now like to remember his selection in a configuration file, and
use this to pre-select these elements on a later run of the program.
Lets assume that I already now the row index of the elements that I want
to set selected.

Unfortunately, I could not find out how to set a specific row of the
ListViewText as selected. The interface of ListViewText is quite clear,
and I think what I am looking for is not in there. I am quite sure that
I have to use the interface of Gtk::TreeSelection for this. The
select(...) functions in there look promising:

select(const TreeModel::Path& path)
select(const TreeModel::iterator& iter)
select(const TreeModel::Row& row)

Unfortunately, the documentation of the Path, iterator and Row classes
did not really help me. Path is practically undocumented. I can create
it from an integer of from a string, but what is the semantics of this?
Row and iterator both turn out to be TreeIter's, but how do I use them
to iterate my TreeSelection (I do not see a "begin()" function there).

Is there a "right" way of achieving this?

Thanks!

Julius



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