1. pygame
  2. Untitled project
  3. pygame


pygame / lib / macosx.py

bob 6e27a08 
bob 63d7f1a 
bob 9ee5c22 
bob 6e27a08 
brian 401c014 
bob 6b987b9 
brian 401c014 
bob 6e27a08 
brian 401c014 

Lenard Lindstrom c35441d 
brian 401c014 

bob 63d7f1a 
bob 6fff2b4 
bob 63d7f1a 
import os, sys
import MacOS
from pygame.pkgdata import getResource

from pygame import sdlmain_osx

__all__ = ['Video_AutoInit']

def Video_AutoInit():
    """This is a function that's called from the c extension code
       just before the display module is initialized"""
    if not MacOS.WMAvailable():
        if not sdlmain_osx.WMEnable():
            raise ImportError("Can not access the window manager.  Use py2app or execute with the pythonw script.")
    if not sdlmain_osx.RunningFromBundleWithNSApplication():
            default_icon_data = getResource('pygame_icon.tiff').read()
        except IOError:
            default_icon_data = None
    if (os.getcwd() == '/') and len(sys.argv) > 1:
    return True