Re: Getting row numbers

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

 



On 5/10/07, David Nečas (Yeti) <yeti@xxxxxxxxxxxxxxx> wrote:
> 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?
>

Not exactly answering your question but, I noticed get_indices array
should not be freed... so I imagine it is not a reentrant function. Is
there a reentrant way to do that ? I'm not needing it right now but,
perhaps I'll need in a future threaded project (yeah, I'm a bit
paranoid, I know) :)

Regards,
Alexandre Moreira.

> Yeti
>
> --
> http://gwyddion.net/
> _______________________________________________
> gtk-list mailing list
> gtk-list@xxxxxxxxx
> http://mail.gnome.org/mailman/listinfo/gtk-list
>
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list


[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux