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/WidgetTest.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/WidgetTest.py')
| -rw-r--r-- | Mac/IDE scripts/Widget demos/WidgetTest.py | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/Mac/IDE scripts/Widget demos/WidgetTest.py b/Mac/IDE scripts/Widget demos/WidgetTest.py deleted file mode 100644 index a2e8d08..0000000 --- a/Mac/IDE scripts/Widget demos/WidgetTest.py +++ /dev/null @@ -1,85 +0,0 @@ -import W - -# define some callbacks -def callback(): - window.close() - -def checkcallback(value): - print "hit the checkbox", value - -def radiocallback(value): - print "hit radiobutton #3", value - -def scrollcallback(value): - widget = window.hbar - if value == "+": - widget.set(widget.get() - 1) - elif value == "-": - widget.set(widget.get() + 1) - elif value == "++": - widget.set(widget.get() - 10) - elif value == "--": - widget.set(widget.get() + 10) - else: # in thumb - widget.set(value) - print "scroll...", widget.get() - -def textcallback(): - window.et3.set(window.et1.get()) - -def cancel(): - import EasyDialogs - EasyDialogs.Message("Cancel!") - -# make a non-sizable window -#window = W.Window((200, 300), "Fixed Size") - -# make a sizable window -window = W.Window((200, 300), "Variable Size!", minsize = (200, 300)) - -# make some edit text widgets -window.et1 = W.EditText((10, 10, 110, 110), "Hallo!", textcallback) -window.et2 = W.EditText((130, 40, 60, 30), "one!") -window.et3 = W.EditText((130, 80, -10, 40), "two?") - -# a button -window.button = W.Button((-70, 10, 60, 16), "Close", callback) - -# a checkbox -window.ch = W.CheckBox((10, 130, 160, 16), "Check (command \xa4)", checkcallback) - -# set of radio buttons (should become easier/nicer) -thebuttons = [] -window.r1 = W.RadioButton((10, 150, 180, 16), "Radio 1 (cmd 1)", thebuttons) -window.r2 = W.RadioButton((10, 170, 180, 16), "Radio 2 (cmd 2)", thebuttons) -window.r3 = W.RadioButton((10, 190, 180, 16), "Radio 3 (cmd 3)", thebuttons, radiocallback) -window.r1.set(1) - -# a normal button -window.cancelbutton = W.Button((10, 220, 60, 16), "Cancel", cancel) - -# a scrollbar -window.hbar = W.Scrollbar((-1, -15, -14, 16), scrollcallback, max = 100) - -# some static text -window.static = W.TextBox((10, 260, 110, 16), "Schtatic") - -# bind some keystrokes to functions -window.bind('cmd\xa4', window.ch.push) -window.bind('cmd1', window.r1.push) -window.bind('cmd2', window.r2.push) -window.bind('cmd3', window.r3.push) -window.bind('cmdw', window.button.push) -window.bind('cmd.', window.cancelbutton.push) - -window.setdefaultbutton(window.button) -# open the window -window.open() - -if 0: - import time - for i in range(20): - window.et2.set(repr(i)) - #window.et2.SetPort() - #window.et2.draw() - time.sleep(0.1) |
