On Wed, 21 Mar 2001, Skip Montanaro wrote:

> 
> How does one discover and/or keep track of the stacking order of
> GnomeCanvasItems?  Based upon the methods I've discovered so far
> (raise_/lower & raise_to_top/lower_to_bottom), there's no way to do either
> of the following:
> 
>     * figure out the stacking order
> 
>     * raise or lower a group of items while maintaining their same relative
>       relationship
> 
> Here's an example.  Suppose I have a canvas widget that contains a mix of
> ellipse, polygon and rect items.  I want to raise or lower all of one type
> of item as a group and maintain the relative stacking order of all items of
> the same group.  Let's suppose the stacking order is (bottom to top):
> 
>     r1, r2, e1, p1, r3, p2
> 
> After I raise the polygons one level, I have
> 
>     r1, r2, e1, r3, p1, p2
> 
> Now, if I raise the polygons again, I will either have
> 
>     r1, r2, e1, r3, p1, p2
> 
> (if p1 was raised first) or
> 
>     r1, r2, e1, r3, p2, p1
> 
> (if p2 was raised first)
> 
> To prevent the second case from happening, I have to know the stacking order
> so I can first raise p1, then raise p2.

If you asked Federico, he would probably say you should have the two items
in a group if you always move them together.  However, if you just want to
know the stacking order, you can use the group.children() method which
returns a list of children of a canvas group.  That should do what you
want.

James.

-- 
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/


_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to