ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> pygame-users
pygame-users
[pygame] pygame from OS X command line
by Ben Willmore other posts by this author
Aug 3 2005 9:46PM messages near this date
Re: [pygame] config_unix.py bugs? | Re: [pygame] pygame from OS X command line
I was excited to see on Bob Ippolito's website that he has updated OS  
X pygame so it will run without either pythonw or being in an app  
bundle.  However, I found when running pygame (today's CVS) from fink  
python2.4, I got the following error:

---
[ben@assam ben] $ python2.4
Python 2.4.1 (#1, Aug  2 2005, 23:12:54)
[GCC 4.0.0 (Apple Computer, Inc. build 5026)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 > >> import pygame
pygame.init()
 > >> pygame.init()
(6, 0)
 > >> screen = pygame.display.set_mode((468, 60))
2005-08-03 21:37:01.917 python2.4[26902] *** Uncaught exception:  
<NSInternalInconsistencyException>  Error (1002) creating CGSWindow
Trace/BPT trap
---

I found this web page on the subject:
http://www.javworld.com/Extreme/GraphicsProg.html

Which enabled me to fix the problem like this:

---
diff -u -ruN -x'*~' pygame-cvs.orig/lib/__init__.py pygame-cvs/lib/ 
__init__.py
--- pygame-cvs.orig/lib/__init__.py     2005-08-03 20:01:31.000000000  
-0700
+++ pygame-cvs/lib/__init__.py  2005-08-03 21:27:14.000000000 -0700
@@ -30,6 +30,8 @@
          from objc import loadBundleFunctions
          import AppKit
          import Foundation
+        if not AppKit.NSApp():
+            AppKit.NSApplicationLoad()
      except ImportError:
          raise ImportError("PyObjC 1.2 or later is required to use  
pygame on Mac OS X")
Thread:
Ben Willmore
Bob Ippolito
Bob Ippolito
Ben Willmore
Ben Willmore
Bob Ippolito
Ben Willmore
Bob Ippolito
Ben Willmore
Bob Ippolito
Ben Willmore
Bob Ippolito
Ben Willmore

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved