Re: GtkTreeView



On 13 Aug 2001, David Bryant wrote:

> GValue value;
> memset(&value, 0, sizeof(value));	// not sure about this
> gtk_tree_model_get_value(model, iter, 2, &value);
> gpointer user_data = value.data[0].v_pointer;	// is this "right" ?

jonathan, if this is really possible with the tree model API, then it's
fundamentally broken. you should not accept a 0-type-value from the user and
g_value_init() it with a type. GValues should always be passed around
properly type initialized, i.e. treemodel should assert that the type
of the value to get is_a
G_VALUE_TYPE (value_passed_to_gtk_tree_model_get_value).

and dave, no, value.data[0].v_pointer is not valid, don't ever
access value.data directly, here you'd use g_value_get_pointer().

> Hope this helps,
> Dave

---
ciaoTJ





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