Re: [gtkmm] Using TreeView/ListStore
- From: Igor Gorbounov <igorbounov voronezh serw ru>
- To: Gooble gooble <yadayuk yahoo com>
- Cc: gtkmm-list gnome org
- Subject: Re: [gtkmm] Using TreeView/ListStore
- Date: Mon, 09 Jun 2003 08:17:33 +0400
Gooble gooble wrote:
In a TreeModel/List store when a row is clicked
(on_row_activated) how do I get access to the row ?
The on_row_activated function has a TreeModel::Path
argument and a TreeViewColumn argument. It is not
clear to me how I can get access to the row elements
using either of these vars.
Gtk::TreeModel::iterator iter = TreeModel->get_iter(path);
row = *iter;
Having a row you can obtain data from any cell on that row:
Glib::ustring s;
int x;
s = row[TreeModel.any_string_column];
x = row[TreeModel.any_int_column];
Here is how you can get the column number:
int column_number = 0;
while (column != YourTree->get_column(column_number))
column_number++;
And so on...
Igor Gorbounov
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]