summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-08-03 14:09:33 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-08-03 14:09:33 (GMT)
commit5150edd9797b506f1cd6f88efb1c2a9e21e22b78 (patch)
tree8d36b99e83a3c48401165d11b2b2cd3373c0fc98 /Mac
parentdffae32172e730393bc7610ede575633d16783d3 (diff)
downloadcpython-5150edd9797b506f1cd6f88efb1c2a9e21e22b78.zip
cpython-5150edd9797b506f1cd6f88efb1c2a9e21e22b78.tar.gz
cpython-5150edd9797b506f1cd6f88efb1c2a9e21e22b78.tar.bz2
Obsolete, EasyDialogs has the same code (but working:-).
Diffstat (limited to 'Mac')
-rw-r--r--Mac/Lib/test/tdlg.py30
-rw-r--r--Mac/Lib/test/tdlg_modeless.py42
2 files changed, 0 insertions, 72 deletions
diff --git a/Mac/Lib/test/tdlg.py b/Mac/Lib/test/tdlg.py
deleted file mode 100644
index 6bb051b..0000000
--- a/Mac/Lib/test/tdlg.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# Function to display a message and wait for the user to hit OK.
-# This uses a DLOG resource with ID=256 which is part of the standard
-# Python library.
-# The ID can be overridden by passing a second parameter.
-
-from Dlg import *
-from Events import *
-import string
-
-ID = 256
-
-def f(d, event):
- what, message, when, where, modifiers = event
- if what == keyDown and modifiers & cmdKey and \
- string.lower(chr(message & charCodeMask)) == 'o':
- return 1
-
-def message(str = "Hello, world!", id = ID):
- d = GetNewDialog(id, -1)
- tp, h, rect = d.GetDialogItem(2)
- SetDialogItemText(h, str)
- while 1:
- n = ModalDialog(f)
- if n == 1: break
-
-def test():
- message()
-
-if __name__ == '__main__':
- test()
diff --git a/Mac/Lib/test/tdlg_modeless.py b/Mac/Lib/test/tdlg_modeless.py
deleted file mode 100644
index 2b6a0f7..0000000
--- a/Mac/Lib/test/tdlg_modeless.py
+++ /dev/null
@@ -1,42 +0,0 @@
-# Function to display a message and wait for the user to hit OK.
-# This uses a DLOG resource with ID=256 which is part of the standard
-# Python library.
-# The ID can be overridden by passing a second parameter.
-# This is the modeless version of this test program, the normal
-# modal version is in tdlg.py
-
-from Dlg import *
-from Evt import *
-from Events import *
-import MacOS
-import string
-
-ID = 256
-
-def message(str = "Hello, modeless world!", id = ID):
- print 'This is to init the console window...'
- d = GetNewDialog(id, -1)
- tp, h, rect = d.GetDialogItem(2)
- SetDialogItemText(h, str)
- while 1:
- ok, ev = WaitNextEvent(0xffff, 10)
- if not ok:
- continue
- if IsDialogEvent(ev):
- ok, window, item = DialogSelect(ev)
- if ok:
- if window == d:
- if item == 1:
- break
- else:
- print 'Unexpected item hit'
- else:
- print 'Unexpected dialog hit'
- else:
- MacOS.HandleEvent(ev)
-
-def test():
- message()
-
-if __name__ == '__main__':
- test()