I’ve tried that, but it didn’t fix anything. The problem is that both Qt and pygame use old carbon functions to show their menu bar, while Apple switched to the newer cocoa for display management and widgets. I think cocoa’s implementation is a bit flaky in 32-bit as this problem does not occur in 64-bit OS X.

 

The problem that now occurs, is because both Qt and pygame try to get hold of the menu bar (with File, edit.. etc.) at the top of the screen. If Qt is initialized first and has gotten hold f the menubar, then pygame hangs upon initialization. Strangely if pygame is initiated shortly before Qt (and destroyed afterwards) it can initialize successfully (and get a hold of the menu bar). That’s why I put that segment of code all the way in the beginning, because it has to execute before the Opensesame UI is initialized

This all might sound vague, but that’s because I’m just speculating and don’t have a real idea what’s going on.

 

 

From: Sebastiaan Mathot [mailto:notifications@github.com] 
Sent: vrijdag 17 mei 2013 11:05
To: smathot/OpenSesame
Cc: Daniel Schreij
Subject: Re: [OpenSesame] Fix to make OpenSesame function on OSX 32-bit (#167)

 

In opensesame:

> @@ -45,6 +45,15 @@ if __name__ == "__main__":
>              import locale
>              if locale.getlocale()[0] is None:
>                      locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
> +                    
> +            # On 32-bit OSX: Shortly init and destroy pygame window before all else
> +            # Strangly, the experiment otherwise hangs at init_dispay() with pygame based backends...
> +            if not sys.maxsize > 2**32:
> +                    import pygame
> +                    pygame.init()
> +                    pygame.display.init()

I noticed that pygame.display.init() is not called in openexp._canvas.legacy.init_display(). Could this be the problem? That adding a call to display init is required on Mac OS, but not other systems?

—
Reply to this email directly or view it on GitHub <https://github.com/smathot/OpenSesame/pull/167/files#r4272380> .  <https://github.com/notifications/beacon/DZPa40xtoOXAtY4fpgxEdu5XPkdK0wPO1ibe_O8FyiHos7L9udWoekuSDGjA1J7R.gif>