On Tue, 2011-07-26 at 18:16 +0200, Daniel Cámpora wrote:
> Hi Jerome,
> 
> After some research and code reading, osgWidgets are much clearer to me. Once 
> I realized the WindowManager - Window - Widgets structure, everything went 
> smoother. I have a couple of questions.
> 
> Is there a method to access or to know which are the widgets a Window has? 
> I'm working with a Canvas Window right now. Looking at the Window definition 
> doesn't add any light to this. I've developed a wrapper on top of this, to be 
> able to list the Widgets, modify them and so on.

You can use the interface provided by the Window's MatrixTransform
parent class (that is, getChild()) or you can use the interface provided
by UIObjectParent. The second is probably preferred.

> When I modify a widget after attaching it to the Window, I need to call 
> "resize" for it to be computed correctly, but I have the feeling I'm resizing 
> all the Window, where I might be well off just by "resizing" the Widget I 
> just modified. Is there a reason why this can't be done in this way? Probably 
> I don't fully understand the process of resizing.

osgWidget has no concept of a Window's "damaged" region; for this
reason, you must always call resize on the Window to get accurate
results. There are ways to cheat it, but I've never tested them...

> From the addremove example from the sources, I see we can either set a mask 
> within the widget (like in "Button"), or add callbacks in the Window. Is 
> there a preference on doing this? E.g., in the addremove example the 
> clickable items change their color from within the widget, whereas in the 
> canvas example this is triggered by a callback in the Window. Are there any 
> efficiency considerations on this?

You MUST set an event mask to get the events in the first place. This
seems like two different questions, perhaps? :)

> Thanks! :)
> 
> Daniel
> 
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=41630#41630
> 
> 
> 
> 
> 
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 


_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to