Skip to content
Permalink
Browse files
Enable game key support
  • Loading branch information
i5o authored and quozl committed Jun 22, 2017
1 parent 1922455 commit a06556e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
@@ -89,7 +89,7 @@ def __init__(self, handle):

self.tubebox = dobject.TubeBox()
self.timer = dobject.TimeHandler("main", self.tubebox)
self.gui = stopwatch.GUIView(self.tubebox, self.timer)
self.gui = stopwatch.GUIView(self.tubebox, self.timer, self)

self.set_canvas(self.gui.display)
self.show_all()
@@ -153,7 +153,7 @@ def _trigger(self):


class OneWatchView():
def __init__(self, mywatch, myname, mymarks, timer):
def __init__(self, mywatch, myname, mymarks, timer, activity):
self._logger = logging.getLogger('stopwatch.OneWatchView')
self._watch_model = mywatch
self._name_model = myname
@@ -253,7 +253,7 @@ def __init__(self, mywatch, myname, mymarks, timer):
self.display.connect('focus-in-event', self._got_focus_cb)
self.display.connect('focus-out-event', self._lost_focus_cb)
self.display.add_events(Gdk.EventMask.ALL_EVENTS_MASK)
self.display.connect('key-press-event', self._keypress_cb)
parent.connect('key-press-event', self._keypress_cb)

self._watch_model.register_view_listener(self.update_state)

@@ -421,7 +421,7 @@ def _keypress_cb(self, widget, event):
class GUIView():
NUM_WATCHES = 9

def __init__(self, tubebox, timer):
def __init__(self, tubebox, timer, activity):
self.timer = timer
self._views = []
self._names = []
@@ -443,7 +443,7 @@ def __init__(self, tubebox, timer):
translator=dobject.float_translator)
self._markers.append(marks_model)
watch_view = OneWatchView(watch_model, name_model, marks_model,
timer)
timer, activity)
self._views.append(watch_view)

self.display = Gtk.VBox()

0 comments on commit a06556e

Please sign in to comment.