Re: [gtk-list] Re: drag and drop



Owen Taylor <otaylor@redhat.com> writes:

> That is an accurate assumption as far as GTK+ goes -
> the children of a widget _are_ drawn inside this
> widget.
> So, basically, GtkTree is broken. The only correct
> fix is to make it compute its allocations so that
> the tree is inside the GtkTreeItem. I do _not_
> want to special case GtkTree inside gtkdnd.c.

thanks for your answer, Owen;

I agree; it's better to fix gtktree;
I have looked at the gtktree and gtktreeitem size_request
and size_allocate functions, and it seems quite possible
to have the tree inside the tree_item;
but I am not sure I fully understand all the request and
alloc mecanism; my only source of information is the source
code (are there any others?);
e.g. the following taken from gtk_tree_size_allocate:
gtk_tree does that for all his children:

 gtk_widget_get_child_requisition (child, &child_requisition);
 child_allocation.height = child_requisition.height;
 gtk_widget_size_allocate (child, &child_allocation);
 child_allocation.y += child_allocation.height;
	      
I understand that gtktree supposes that his allocation height will be 
equal to his requisition; if it's not the case some of the children
will be drawn outside the tree; am I right?

another thing I have been unable to found:
when and by whom the requisition field of a widget is filled?
for the allocation I see it's in the size_allocate, but I haven't
found for the requisition;

> If you possibly can, you should be using the GtkCTree
> instead of the GtkTree. The CTree isn't perfect
> itself, but it is better tested and more actively
> developed these days. 

I'll try but I have never used it

Hubert



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