Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
5150edd9
Commit
5150edd9
authored
Aug 03, 2001
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Obsolete, EasyDialogs has the same code (but working:-).
parent
dffae321
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
72 deletions
+0
-72
Mac/Lib/test/tdlg.py
Mac/Lib/test/tdlg.py
+0
-30
Mac/Lib/test/tdlg_modeless.py
Mac/Lib/test/tdlg_modeless.py
+0
-42
No files found.
Mac/Lib/test/tdlg.py
deleted
100644 → 0
View file @
dffae321
# 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
()
Mac/Lib/test/tdlg_modeless.py
deleted
100644 → 0
View file @
dffae321
# 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
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment