views:

30

answers:

1

I managed to get it working on Win32 (inheriting from wx.MiniFrame does the trick), on wxGTK (wx.PopupWindow) but whatever I try, when I create a frame on wxMac, my main window loses focus and the new frame gets it.

wxMac does not seem to have a way to interact with the native platform (something like GetHandle() on Win32 and GetGTKWidget() on wxGTK), so I can't hack around it this way.

I managed to get this working in another situation, by creating the frame at startup and moving it outside of the display area, then moving it in a visible position when needed. But right now this would be cumbersome because I don't know in advance how many frames I will need.

So, any simpler way to do this ?

A: 

If you want to get native handle to window in Mac you can do

frame.MacGetTopLevelWindowRef()

and may be you can use pyobjc to interact with windows natively, but why don't you set focus on the window you want to after opening mini-frame?

Anurag Uniyal
Because it doesn't work. I've tried many things based on SetFocus() at different moments and none actually give the focus back to the main frame.
fraca7
Okay, this is the function I was looking for. Now trying to get some actual documentation about Carbon and use ctypes...
fraca7