PageRenderTime 122ms CodeModel.GetById 100ms app.highlight 2ms RepoModel.GetById 19ms app.codeStats 0ms

/pyjs/tests/test013.py

http://pyjamas.googlecode.com/
Python | 14 lines | 10 code | 4 blank | 0 comment | 3 complexity | bb9eb99582cd767513ec19c00b15e0e0 MD5 | raw file
 1import DOM
 2
 3class FocusWidget:
 4
 5    def __init__(self, element):
 6        self.clickListeners = []
 7
 8    def addClickListener(self, listener):
 9        self.clickListeners.append(listener)
10
11    def onBrowserEvent(self, event):
12        if DOM.eventGetType(event) == Event.ONCLICK:
13            for listener in self.clickListeners:
14                listener(self)