[Pythonmac-SIG] Menus for wxPythonMac

Bob Ippolito bob@redivi.com
Sun, 6 Jan 2002 18:56:41 -0500


That's quite a hairy issue.  You see, the way WindowServer and the Dock 
work, to my knowledge, is that they just *will not* register two 
separate dock instances or two menus for the same pid.

It is possible to change the menu bars dynamically, so, with appropriate 
fixes to wxWindows and/or wxPython's source code it could work by using 
submenus or something under PythonInterpreter.  But until apple (which 
they will almost certainly never do...) properly documents WindowServer 
and the behind-the-scenes stuff that goes on it's going to be pretty 
difficult to see flawless operation of any scripting language with the 
GUI.

The only solution I can think of is to make dummy application bundles 
and launch them in separate processes, and have some sort of socket 
communication between wxPython and the dummy bundles.  Each bundle would 
have to have a unique name because WindowServer seems to use argv[0] as 
it's key to redirect events back to the application, so it could get 
confused.  This is a terrible hack, but it would almost certainly work.  
The problem is that all communication to windows probably has to be done 
over sockets, unless you can get an NSApplication pointer to the dummy 
app or something, which would be awfully cool.  It'd be a lot of work 
though, obviously.

-bob

On Sunday, January 6, 2002, at 04:22 PM, Kevin & Masako Ollivier wrote:

> Sorry for the cross-posting, but I thought I'd cover all my bases! =)
>
> I'll briefly explain where I'm at. I'm using the Carbon version of 
> Python
> 2.2, along with wxWindows and wxPython on OS X 10.1.2. I've pulled all 
> the
> sources from CVS. Everything compiles, and so far I've been able to run
> wxPython scripts with a limited degree of success. However, the major
> problem is that I'm still having troubles with the menus. When I load a
> wxPython script in Python, Python's menubars stay active and the menus
> created by the script are nowhere to be found. Has anyone else 
> experienced
> this?
>
> Also, when I run the script it does not open as a separate application 
> in OS
> X. All windows are listed as child windows of the Python application. 
> I'm
> wondering if these two issues are related. wxPython may not be able to
> modify Python's menus, and since it does not have its own application, 
> it
> has no way of showing its own menus. Does this make sense? I admit I'm
> pretty new to Mac programming, and as such I'm a bit stuck as to what 
> can be
> done about this problem. Any help would be appreciated!
>
> Thanks,
>
> Kevin
>
>
>
>
> _______________________________________________
> Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig