--- a/demo_tableview.py Wed Dec 26 01:00:31 2012 +0100
+++ b/demo_tableview.py Sat Dec 29 12:16:06 2012 +0100
@@ -12,7 +12,7 @@
class MyApplication(Application):
def __init__(self):
Application.__init__(self)
- self.top.connect('keypress', self.globalkeypress)
+ self.top.connect('keypress', self.on_top_keypress)
data = []
for y in range(100):
@@ -21,19 +21,19 @@
row.append('r{}:c{}'.format(y, x))
data.append(row)
model = TableModel(data)
-
+
view = TableView(model)
view.addcolumn(header=True, expand=False, sizereq=5)
for x in range(10):
view.addcolumn(title='head'+str(x))
-
+
self.top.add(view, expand=True, fill=True)
vert = VerticalLayout()
self.top.layout(vert)
- def globalkeypress(self, keyname, char):
- if keyname == 'escape':
+ def on_top_keypress(self, ev):
+ if ev.keyname == 'escape':
self.terminate()