summaryrefslogtreecommitdiff
path: root/sys/src/cmd/python/Demo/tix/grid.py
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@localhost>2011-05-03 11:25:13 +0000
committercinap_lenrek <cinap_lenrek@localhost>2011-05-03 11:25:13 +0000
commit458120dd40db6b4df55a4e96b650e16798ef06a0 (patch)
tree8f82685be24fef97e715c6f5ca4c68d34d5074ee /sys/src/cmd/python/Demo/tix/grid.py
parent3a742c699f6806c1145aea5149bf15de15a0afd7 (diff)
add hg and python
Diffstat (limited to 'sys/src/cmd/python/Demo/tix/grid.py')
-rw-r--r--sys/src/cmd/python/Demo/tix/grid.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/sys/src/cmd/python/Demo/tix/grid.py b/sys/src/cmd/python/Demo/tix/grid.py
new file mode 100644
index 000000000..07ca87f8e
--- /dev/null
+++ b/sys/src/cmd/python/Demo/tix/grid.py
@@ -0,0 +1,28 @@
+###
+import Tix as tk
+from pprint import pprint
+
+r= tk.Tk()
+r.title("test")
+
+l=tk.Label(r, name="a_label")
+l.pack()
+
+class MyGrid(tk.Grid):
+ def __init__(self, *args, **kwargs):
+ kwargs['editnotify']= self.editnotify
+ tk.Grid.__init__(self, *args, **kwargs)
+ def editnotify(self, x, y):
+ return True
+
+g = MyGrid(r, name="a_grid",
+selectunit="cell")
+g.pack(fill=tk.BOTH)
+for x in xrange(5):
+ for y in xrange(5):
+ g.set(x,y,text=str((x,y)))
+
+c = tk.Button(r, text="Close", command=r.destroy)
+c.pack()
+
+tk.mainloop()