Bring pyglet.window to front in OSX?

60 views
Skip to first unread message

Winston Wolff

unread,
Apr 20, 2012, 2:57:27 PM4/20/12
to pyglet...@googlegroups.com
I've got a Pyglet app (actually a cocos2d game which uses Pyglet) and I've used py2app to create an .app bundle. When I launch the app, the window doesn't appear until I click on another app and then click onto my app's icon in the dock. Has anybody else seen this behavior? My setup:

MacOSX 10.7.3
Pyglet 1.2 dev
Python 2.7.2

-Winston

Nathan

unread,
Apr 27, 2012, 11:24:24 AM4/27/12
to pyglet...@googlegroups.com
Does it happen before you create the .app bundle?

~ Nathan
> --
> You received this message because you are subscribed to the Google Groups "pyglet-users" group.
> To post to this group, send email to pyglet...@googlegroups.com.
> To unsubscribe from this group, send email to pyglet-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en.
>

Winston Wolff

unread,
Apr 27, 2012, 11:56:49 AM4/27/12
to pyglet...@googlegroups.com
If I run the python script from the command line, i.e. it has not been bundled into an App, the window does come to the front.

-ww

Tristam MacDonald

unread,
Apr 27, 2012, 12:24:15 PM4/27/12
to pyglet...@googlegroups.com
On Fri, Apr 27, 2012 at 11:56 AM, Winston Wolff <winsto...@cal.berkeley.edu> wrote:
If I run the python script from the command line, i.e. it has not been bundled into an App, the window does come to the front.

-ww

I have no clue what branch 1.2 dev is at this point. Is that a Carbon or Cocoa based pyglet?

Along with all the fullscreen stuff in 10.7's window manager, they seem to have changed how apps grab focus. The approach I used in the Cocoa port is pretty much a hack, and I never have tested it from within an .app bundle (theoretically, the hack should be unnecessary, and possibly detrimental, when running from an app bundle).

--
Tristam MacDonald
System Administrator, Suffolk University Math & CS Department

Reply all
Reply to author
Forward
0 new messages