oscarah
unread,Jul 8, 2009, 3:53:13 PM7/8/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to gaphor-dev
Hello again,
I'm progressing in my project ;) I've created an entity, Container,
which is, obviously, a virtual container. It only has the ability to
insert items on his own canvas as children, something like
'self._canvas.add(item, self)'.
In order to allow inserting items before adding the container to
canvas, I've delayed the insertion until parent canvas is ready. So, I
use the method "setup_canvas" to actually add children to canvas. But,
a problem arise! (of course ;) )
On method 'setup_canvas()' I can not add an item to canvas, using self
as parent. As example, next code will raise an exception:
def setup_canvas(self):
self._canvas.add(an_item, self)
The problem is that 'self' instance has not been fully added to
canvas, so 'update_matrix()' is not called yet. Then, 'self' has
'_matrix_i2c' to None.
I've tested a change for a while, without any problem. I've modified
the method 'canvas.add()', in order to call 'item._set_canvas()' at
the end. Thus, everything is finished, and I can add items.
What do you thing about it? May it introduce any problem?
Thanks for your time.
Oscar.