specific gui sorting

I’m building something where I have two DirectFrames, one is on base.a2dTopLeft, and the other is on base.a2dTopRight

Each frame is movable etc, that’s no issue.
When I want to sort ‘pop’ or ‘move this frame to the front, so that it’s shown in front of every other frame’ what I am doing by default is re parenting the frame to it’s parent, which essentially moves it in front of the others on that parent.

That for instance, works if I have both frames on aspect2d.

However, if both frames are on seperate nodes (base.a2dTopLeft, and base.a2dTopRight, respectively) then reparenting the frame to it’s parent node, only works for the frames under that node.

In short: I’ve got two frames on separate base.a2d_blank_ nodes, and I want to be able to move a certain one to the front of all the others, how could I do this?

My other thought, since I have a need to only ‘pop’ or ‘move-the-frame-to-front’ for one frame at a time, I found out I could reparent base.a2dTopLeft to aspect2d, and that does work for me.

The question is, “Would that be the proper way?”, I’m thinking it may be, I would so very much appreciate someone else helping me with this issue, or confirming if my fix of reparenting the base.a2dTopLeft to aspect2d, as a correct solution for my problem?

EDIT:
After reviewing again, reparenting base.a2dTopLeft to aspect2d only works if you have one DirectFrame under base.a2dTopLeft, otherwise it moves all DirectFrames under base.a2dTopLeft in front of any other ones.
I’m looking for a per-node-cascading fix I suppose then.

Thank you,
~powerpup118

Assuming you want to keep the automatic window-resizing behavior of a2dTopLeft and so on, you’re probably best off using binning to explicitly order your frames. For instance, you can use frame.setBin(‘fixed’, 10) on frame A, and frame.setBin(‘fixed’, 20) on frame B, and then frame B will always appear on top of frame A.

But once you start using binning, you have to be explicit on all of the objects that might overlap each other.

David

You’re correct David,
using binning is exactly what I wanted.
I played with binning for a while, and after words realized it was perhaps more work in my specific case, than it was just to set the frames position to base.a2dTopLeft.getPos(), and then if the user resizes the window, they’ll have to move the windows further out on their own. (I’m making ‘moveable’ gui frames)

Thank you tons for your help, this will deffinetly help me with some other problem’s I’ve been having!

Thank you again,
~powerpup118