from a base frame I call frame 1 and from here frame 2;
now from the base frame I call frame 3 and from here the same frame 2 (I know the address);
question: how can I make frame 2 come forward without destroying &
creating it again (or having lots of instances)?
frame2.Raise() ?
then frame2 comes up nicely but frame3 takes a dive behind frame1! What I need, I think, is frame2.SetParent(…), but there is nothing like that because, I suspect, it carries similar costs as destroy/create…
Looks like you want to keep track of the z-order of your frames.
Create an empty list, make it an App’s member. Append a reference to each frame created to that list. Bind the frame’s wx.EVT_ACTIVATE event to an App’s handler.
On the handler, pop the activated frame from the list and append it again. The list will then be keeping track of the frames z-order, bottom to top.
Now you have the z-order and will be able to apply Raise according to the application needs.
Well, what I described was only a little string of my application which I wanted to tune and in contrast to what you suggest I lean more towards Python; so I don’t only have frame2 but frame2a and frame2b which can both call each other; these two frames I handle by a singleton proxy and the proxy can be called by starting with frame2a or frame2b and as far as wx is concerned everything is standard: no special styles, the caller is used as parent and the two frames just pop up as one moves the cursor; the problem starts when the caller changes: the proxy should inform the two frames of that fact and everything would be alright again; but, unfortunately, that only seems to be possible by a destroy/create cycle (I was dreaming of handing over the changed parent with the next frame2.Show(True, parent) )