On Mon, Nov 21, 2011 at 7:01 PM, Tristam MacDonald <[email protected]>wrote:
> I cloned the evilphillip-cocoa-ctypes repository from google code, and
> that does bring up a window and perform basic rendering, but there is a
> constant stream of warnings on the console, and mouse events seem to cause
> everything to crash. I wasn't able to execute even the first test from
> tests/tests.py.
>
My apologies - after several minutes of churning, PyPy did indeed execute
the tests from tests/tests.py. I am not quite sure why it took so long to
prepare, but no mind.
The mouse event error turned out to be a missing void return type
specification for the call to [NSApplication sendEvent:], a working patch
is as follows:
===============================================================
diff -r b4dd39184f08 pyglet/app/cocoa.py
--- a/pyglet/app/cocoa.py Wed Apr 06 07:54:59 2011 -0500
+++ b/pyglet/app/cocoa.py Mon Nov 21 19:30:40 2011 -0500
@@ -109,7 +109,7 @@
if event_type != NSApplicationDefined:
# Send out event as normal. Responders will still receive
# keyUp:, keyDown:, and flagsChanged: events.
- send_message(self.NSApp, 'sendEvent:', event)
+ send_message(self.NSApp, 'sendEvent:', event, restype=None)
# Resend key events as special pyglet-specific messages
# which supplant the keyDown:, keyUp:, and flagsChanged:
messages
===============================================================
I can't seem to get pypy to pickup keyboard events - the pyglet window
isn't managing to take focus away from the terminal window. The fix for
this is to run from within an App bundle (or pretend to, as the system
'pythonw' does), but that part of my original Cocoa port doesn't seem to
have survived the development process.
--
Tristam MacDonald
System Administrator, Suffolk University Math & CS Department
http://swiftcoder.wordpress.com/
--
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pyglet-users?hl=en.