Hi Juergen,

On Fri, 2006-04-07 at 16:54 +0200, Soenke 'Juergen' Schwardt wrote:
> Tack, just a small stupid question since I didn't dive into kaa.canvas
> yet:

As I always say: there are no stupid questions; nly stupid people. :)

> ,----
> |  text = canvas.add_child(kaa.canvas.TextBlock(), width = "50%",
> |                          hcenter = "50%", vcenter = "50%")
> `----
> 
> What does add_child() return after being called?
> a) The whole canvas object or 
> b) a special TextBlock canvas object or 
> c) the TextBlock object that was given as argument?
> Or is b) and c) the same?

c.

There's no "special" objects or anything.  add_child() returns the first
parameter given to it strictly as a convenience so you can code in the
above (quoted) form.  So:

   img = kaa.canvas.Image("foo.png")
   container.add_child(img)

is semantically identical to:

   img = container.add_child(kaa.canvas.Image("foo.png"))

Also this works, but I'm not sure if I'm going to keep this API:

   img = container.add_image("foo.png")

It's another convenience function but it requires methods to be
explicitly added to kaa.canvas.Container for each object type, so it's
not very elegant.  I'll probably end up removing that style of call, so
don't use it. :)

Cheers,
Jason.



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Freevo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to