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

Re: Associating with an entry in a GtkListStore




 There is a way to associate the data with the model.

 You could use your model like this.

 gtk_list_store_new( NUM_ENTRIES, G_TYPE_STRING, G_TYPE_POINTER)

Where the TYPE_STRING holds the description and the POINTER holds the binary
data.

 That way when you want to associate them, you sjut poull them with 
model_get(..) fuction together.

 The key point here is that the treeview DOES NOT have to have the same number
of columns as the model.


  Hope this helps.

HArring


--- Chris Seaton <chris@chrisseaton.com> wrote:
> I'm using a GtkListStore with a GtkTreeView to show a simple list of 
> items. Each item has a text name and binary data. The list just needs to 
> show the name - the binary data is stored elsewhere in memory and is 
> used when the user selects commands from a menu (I'm making things 
> simplier than they are here, but the principle is the same).
> 
> The problem is: how do I associate the entry in the list store with my 
> binary data? There is no user field for the list store items like with 
> the signal handler functions, and there could be more than one item with 
> exactly the same name but different binary data so I can't use a hash 
> table or something.
> 
> I would use the index of the item (from the itterator), but I'm not sure 
> to do that, and anyway the indicies would change when the list is sorted 
> by clicking on column headers.
> 
> Suggestions?
> 
> Chris Seaton
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/



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