Ejemplo n.º 1
0
    def __init__(self, hook, debug=False, compat_layout=False):
        super(Manager, self).__init__()
        self.hook = hook
        self.debug = debug
        self.compat_layout = compat_layout
        self.unicodePolicy = ('ignore', )

        if in_fife:
            if not hook.engine.getEventManager():
                raise InitializationError("No event manager installed.")
            if not hook.guimanager:
                raise InitializationError("No GUI manager installed.")
        timer.init(hook.engine.getTimeManager())

        self.fonts = {}
        #glyphs = ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!?-+/:();%`\'*#=[]"'
        self.fonts['default'] = hook.default_font

        self.styles = {}
        self.addStyle('default', DEFAULT_STYLE)

        Manager.manager = self

        # Setup synchronous dialogs
        self.mainLoop = None
        self.breakFromMainLoop = None
        self.can_execute = False

        import weakref
        self.allWidgets = weakref.WeakKeyDictionary()

        # Autopos
        from autoposition import placeWidget
        self.placeWidget = placeWidget
Ejemplo n.º 2
0
	def __init__(self, hook, debug = False, compat_layout = False):
		super(Manager,self).__init__()
		self.hook = hook
		self.debug = debug
		self.compat_layout = compat_layout
		self.unicodePolicy = ('ignore',)

		if in_fife:
			if not hook.engine.getEventManager():
				raise InitializationError("No event manager installed.")
			if not hook.engine.getGuiManager():
				raise InitializationError("No GUI manager installed.")
		timer.init(hook.engine.getTimeManager())

		self.fonts = {}
		#glyphs = ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!?-+/:();%`\'*#=[]"'
		self.fonts['default'] = hook.default_font

		self.styles = {}
		self.addStyle('default',DEFAULT_STYLE)

		Manager.manager = self

		# Setup synchronous dialogs
		self.mainLoop = None
		self.breakFromMainLoop = None
		self.can_execute = False

		import weakref
		self.allWidgets = weakref.WeakKeyDictionary()

		# Autopos
		from autoposition import placeWidget
		self.placeWidget = placeWidget