Re: [gtk-list] tree{,item} widget questions
- From: Tim Janik <timj gimp org>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] tree{,item} widget questions
- Date: Mon, 9 Mar 1998 12:03:56 +0100 (CET)
On 8 Mar 1998, Michael Poole wrote:
> I was browsing through the tree widget source for 0.99.4, and I had
> two questions:
>
> 1) If I wanted to tack on 'satellite' data to something such as a
> GTKTreeItem (to hook on my own data to a tree item to refer to when
> the user selects the item), is gtk_object_{set,get}_data (or the
> {get,set}_user_data wrappers) the "right" way to do this?
gtk_object_set_data/gtk_object_get_data or gtk_object_set_data_full is what
you want.
> 2) In gtk_tree_insert, there's a check to make sure the new child is a tree
> item, but there's no such check in gtk_tree_add; is this intentional?
> There are (unprotected, as nearly as I can determine) GTK_TREE_ITEM()
> casts made on a child in:
> gtk_tree_draw, gtk_tree_foreach, gtk_tree_map, gtk_tree_remove_items,
> gtk_tree_size_allocate, and gtk_tree_size_request
> and there are type-checked casts several other places. It seems likely
> to me that the intention was for a GTKTree to only allow GTKTreeItems
> as children, although these GTKTreeItems may have other kinds of
> children themselves (which is allowed -- or at least handled -- in
> gtk_tree_button_press).
quoting from the TODO:
* GtkTree and GtkList should express in their *_add implementations,
that they expect GtkListItems/GtkTreeItems as children. Similar
things might apply to other containers.
>
> Thanks in advance,
> - Michael
>
---
ciaoTJ
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]