Re: [gtk-list] Re: glib datalists question




On Wed, 10 Nov 1999, Verwerft, Marc wrote:
> 	No, it will never take a NULL value, not even when the destroy
> notify function is NULL.
> 	I've made a small, but otherwise useless ;-}, program that shows the
> behaviour.
> 
> 	Is there another way to save a set of name/value pairs with NULL
> values using glib ?
> 

Your test program takes NULL on my system, it outputs:

---- 'foreach' iteration ----
fifth: 2000
fourth: 1000
third: 2
first: 1

Of course, as I said, setting something to NULL is equivalent to unsetting
it. So the NULL value is not included in the dataset. But there is no 
error or anything like that.

Perhaps you want a hash table? A dataset is for associating data with
objects, like gtk_object_get_data()/gtk_object_set_data().
A hash table is for storing key-value pairs.

Havoc




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