Re: TreeModel selected row number
- From: John Taber <jtaber johntaber net>
- To: Murray Cumming <murrayc murrayc com>
- Cc: gtkmm-list <gtkmm-list gnome org>
- Subject: Re: TreeModel selected row number
- Date: Tue, 22 Mar 2005 10:07:32 -0700
On Tuesday 22 March 2005 09:35, Murray Cumming wrote:
> > It is actually very useful if the tree is being used as any sort of list
> > box.
>
> I don't understand. You have a list of colors, for example. You can find
> out what color has been selected. Why do you need to know what
> alphabetical sort position the color had in a list?
>
simply for flexibility and to avoid string comparisons
int rowSelected = treeModel.row_selected()
switch (rowSelected) {
case 0: {
...
//if I want to key to somethingelse[rowSelected]
.......
currently I think this would have to be done:
std::string color = row[menuColums.color]
if (color == "blue") {...}
//if I want to key to somethingelse have to find index of "blue"
John
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]