[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] simple Mac .nib loading from pygame?
On Apr 13, 2004, at 7:28 AM, Jack Nutting wrote:
As work on spinvaders baby-steps forward (
http://www.nuthole.com/spinvaders.zip ), I'd like to add
platform-specific niceties such as a .nib file containing a proper
menu etc for the Mac version. I've tried to include a .nib file using
bundlebuilder by including the nib in my 'resources' (it is
successfully copied) and the '--nib' command-line option, but so far
no good; All I get is the bare-bones menu at the top. All I want to
do with the .nib is have a menu with an 'About' panel and such (no
actual integration with the python code itself), so I don't want to
get too deep into PyObjC issues or anything just yet. Any ideas,
anyone?
Unfortunately, you will have to "dig deep" into PyObjC issues. In
order to get those menus picked up, you will have to start your
application via PyObjCTools.AppHelper.runEventLoop() and start the
pygame event loop from the applicationDidFinishLaunching:
NSApplicationDelegate notification. You'll probably have this
NSApplicationDelegate instantiated by the nib file because you will
need to use it as a target for all of the menu actions.
I'll see about doing a tutorial or something later on in the week.
Remind me if I don't.
-bob