Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] Help fetching values from a GtkTreeView

From: Stephen Fisher <stephentfisher@xxxxxxxxx>
Date: Wed, 5 Dec 2007 19:14:55 -0700
On Thu, Dec 06, 2007 at 12:59:02AM +0100, Stig Bj?rlykke wrote:

> As I'm trying to implement the "Apply as Filter" menu in the Protocol
> Hierarchy Statistics window, I have a problem storing the
> hfinfo->abbrev value in the node and then fetch this in the
> select_filter callback.  I have no experience with Gtk programming, so
> I need some help here :)
>
> Anyone able to give me some hints?

I haven't used GtkTreeView as a tree before, but when using it as a
list, you make the final field a G_TYPE_POINTER.  A G_TYPE_POINTER (as
opposed to, say, a G_TYPE_STRING) isn't displayed to the user - it is
only used for you to store and retrieve values.  I assume it works the
same way with a GtkTreeView tree.  Check out the GtkTreeStore functions
in the GTK+ docs as I believe that is what is needed to store and
retrieve the value of the G_TYPE_POINTER "field" by passing a gpointer
(a "void *") instead of a string that you see in the examples.

I hope this helps.  I don't remember much this functionality at the
moment, but if more comes back to me, I'll let you know :)


Steve