ON_TOP_LUMINANCE = 0.6
ON_BOTTOM_LUMINANCE = 0.9
ON_SATURATION = 1
-ON_COLUMN_OVERSIZING = 1.75
+ON_COLUMN_OVERSIZING = 2
ON_COLUMN_ALPHA = 1
FONT = pygame.font.Font(None, 80)
FONT_COLOR = (0,0,0)
EventDispatcher.addEventListener(v.__eventtype__, listener)
def ctor(self, *args, **kw) :
- init_listeners(self)
default_ctor = dict.get('__init__')
if not default_ctor :
super(cls, self).__init__(*args, **kw)
else :
default_ctor(self, *args, **kw)
+ init_listeners(self)
cls.__init__ = ctor
$URL$
"""
-#from pgu.gui import Desktop
-#from pgu.gui import QUIT
+from pgu.gui import Desktop
+from pgu.gui import QUIT
from widgets.home import Home
from widgets.playingscreen import PlayingScreen
class MinWii(object):
def __init__(self) :
- playingScreen = PlayingScreen()
- playingScreen.run()
+ app = Desktop()
+
+ if True :
+ home = Home()
+ home.connect(QUIT, app.quit)
+ app.run(home)
+ app.close(home)
+
+ playingScreen = PlayingScreen()
+ playingScreen.run()
def __init__(self, theme='black', duration=50, blinkMode=True):
pygame.sprite.DirtySprite.__init__(self)
- pygame.mouse.set_visible(False)
imagesPath, images = WarpingCursor._get_theme_images(theme)
flashImage = images.pop(images.index('flash.png'))
flashImagePath = os.path.sep.join([imagesPath, flashImage])
self.duration = duration
self.image = self.images[0]
- self.rect = pygame.Rect((-self.width/2,-self.height/2), (self.width, self.height))
+ # workarround cursor alignement problem
+ pygame.event.set_blocked(pygame.MOUSEMOTION)
+ pygame.mouse.set_pos(pygame.mouse.get_pos())
+ pygame.event.set_allowed(pygame.MOUSEMOTION)
+ # ---
+ x, y = pygame.mouse.get_pos()
+ print 'mouse pos :', x, y
+ left = x - self.width / 2
+ top = y - self.height / 2
+ self.rect = pygame.Rect((left, top), (self.width, self.height))
self.blinkMode = blinkMode
self._startBlink()
+
+ def _stopBlink(self) :
+ if self.blinkMode :
+ pygame.time.set_timer(TIMEOUT, 0)
def _startBlink(self) :
if self.blinkMode :
self._running = False
self.draw(pygame.display.get_surface())
self._initCursor()
-
def _initRects(self) :
dirty = self.draw(pygame.display.get_surface())
pygame.display.update(dirty)
clock.tick(FRAMERATE)
+
+ self.cursor._stopBlink()
@event_handler(pygame.KEYDOWN)
def handleKeyDown(self, event) :
fs.program_select(0, fsid, bank, preset)
def __del__(self) :
+ print 'PlayingScreen.__del__'
self.fs.delete()
@event_handler(events.NOTEON)