How to use DirectFrame to group multiple DirectGUI objects

Hi people,

Can anyone give me an example on how to use DirectFrame?

I hope it can be used to arrange 3 icons (images) and some text.

Later I want to put it in some kind of popup window (maybe a DirectDialog)

Thanks in advance,
srehder

No trouble. Just create a DirectLabel for each icon or text item you want to attach to your DirectFrame, and specify the frame as the parent. Then you can position each icon individually.

David

If what you mean by arranging is more like using wxwidgets’ sizer, goto CodeSnippet, there is some code by chombee you can use.

Ah thanks, so I can just use DirectLabelObject.reparentTo(DirectFrameObject) and then the positions specified on the DirectLabelObject will be relative to the DirectFrameObject?

Thats brilliant!

/srehder

Yeah, but it’s easier (and perhaps better) to just specify parent=DirectFrameObject in the constructor.

Great, thanks :slight_smile:

I would love to see that code, but can’t find it. Can anyone provide a link?

discourse.panda3d.org/viewtopic.php?t=4174