Re: Getting row numbers
- From: David Nečas (Yeti) <yeti physics muni cz>
- To: gtk-list gnome org
- Subject: Re: Getting row numbers
- Date: Thu, 10 May 2007 16:19:34 +0200
On Thu, May 10, 2007 at 06:46:49AM +0200, richard boaz wrote:
> maybe this will help? the following callback will get the row number of the
> row when double-clicked by the user. basically, convert a GtkTreePath to a
> string. you must take proper care if you have a tree deeper than one level.
>
> void recordActivate(GtkTreeView *treeview, GtkTreePath *arg1,
> GtkTreeViewColumn *arg2, gpointer *hdrList)
> { // called when record double-clicked
> char *row;
> int rowNum;
>
> row = gtk_tree_path_to_string(arg1);
> rowNum = atoi(row);
> g_free(row);
> }
What is the point of the numbers -> string -> number
conversion when gtk_tree_path_get_indices(path)[0] is
the requested number?
Yeti
--
http://gwyddion.net/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]