diff options
| author | Thomas Wouters <thomas@python.org> | 2006-06-08 14:52:47 (GMT) |
|---|---|---|
| committer | Thomas Wouters <thomas@python.org> | 2006-06-08 14:52:47 (GMT) |
| commit | 1ba5b3b425e970ec3e4a19165475aa68fa5ac893 (patch) | |
| tree | 607d666a002704ccb6a8cc5d1739b729a64cc615 /Mac/IDE scripts/Widget demos/KeyTester.py | |
| parent | 4d70c3d9dded0f0fa7a73c67217a71111d05df4d (diff) | |
| download | cpython-1ba5b3b425e970ec3e4a19165475aa68fa5ac893.zip cpython-1ba5b3b425e970ec3e4a19165475aa68fa5ac893.tar.gz cpython-1ba5b3b425e970ec3e4a19165475aa68fa5ac893.tar.bz2 | |
Merged revisions 46607-46608 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r46607 | neal.norwitz | 2006-06-03 06:49:00 +0200 (Sat, 03 Jun 2006) | 1 line
Remove Mac OS 9 support (http://mail.python.org/pipermail/python-dev/2006-June/065538.html)
........
r46608 | martin.v.loewis | 2006-06-03 09:37:13 +0200 (Sat, 03 Jun 2006) | 2 lines
Port to OpenBSD 3.9. Patch from Aldo Cortesi.
........
Diffstat (limited to 'Mac/IDE scripts/Widget demos/KeyTester.py')
| -rw-r--r-- | Mac/IDE scripts/Widget demos/KeyTester.py | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/Mac/IDE scripts/Widget demos/KeyTester.py b/Mac/IDE scripts/Widget demos/KeyTester.py deleted file mode 100644 index ae47550..0000000 --- a/Mac/IDE scripts/Widget demos/KeyTester.py +++ /dev/null @@ -1,34 +0,0 @@ -"""Simple W demo -- shows how to make a window, and bind a function to a "key" event.""" - -import W - -# key callback function -def tester(char, event): - text = "%r\r%d\r%s\r%s" % (char, ord(char), hex(ord(chart)), oct(ord(char))) - window.keys.set(text) - -# close callback -def close(): - window.close() - -# new window -window = W.Dialog((180, 100), "Type a character") - -# make a frame (a simple rectangle) -window.frame = W.Frame((5, 5, -5, -33)) - -# some labels, static text -window.captions = W.TextBox((10, 9, 43, -36), "char:\rdecimal:\rhex:\roctal:") - -# another static text box -window.keys = W.TextBox((60, 9, 40, -36)) - -# a button -window.button = W.Button((-69, -24, 60, 16), "Done", close) - -# bind the callbacks -window.bind("<key>", tester) -window.bind("cmdw", window.button.push) - -# open the window -window.open() |
