+
+ def __init__(self, screen, eventmap):
+ self.__screen = screen
+ self.__eventmap = eventmap
+ self.__passall = not isinstance(screen, InfoBarBase) # let pass all events to screens not derived from InfoBarBase
+ EventMap = ServiceEventTracker.EventMap
+ if not len(EventMap):
+ screen.session.nav.event.append(ServiceEventTracker.event)
+ ServiceEventTracker.navcore = screen.session.nav
+ EventMap = EventMap.setdefault
+ for x in eventmap.iteritems():
+ EventMap(x[0], []).append((self.__passall, screen, x[1]))
+ screen.onClose.append(self.__del_event)
+
+ def __del_event(self):
+ EventMap = ServiceEventTracker.EventMap.setdefault
+ for x in self.__eventmap.iteritems():
+ EventMap(x[0], []).remove((self.__passall, self.__screen, x[1]))