SelectorWidget
[naja.git] / naja / widgets / base.py
index 81f11b649df9734371017f34891fa3ec6b360505..c82026179c9856b4812f6937d433881a8321fddc 100644 (file)
@@ -3,7 +3,7 @@ from collections import defaultdict
 import pygame
 from pygame import locals as pgl
 
-from naja.events import InvalidateTheWorld
+from naja.events import InvalidateTheWorld, SelectEvent
 
 
 class Widget(object):
@@ -38,7 +38,7 @@ class Widget(object):
             # True for for this event
             self._prepared = False
             return False
-        if ev.type == pgl.MOUSEBUTTONDOWN:
+        if SelectEvent.matches(ev) or ev.type == pgl.MOUSEBUTTONDOWN:
             self.callback('click')
         return False