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
368fc2cc
Commit
368fc2cc
authored
Aug 17, 1995
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Uses new FrameWork, has multiple windows
parent
a16957e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
31 deletions
+46
-31
Mac/Lib/test/tlist.py
Mac/Lib/test/tlist.py
+46
-31
No files found.
Mac/Lib/test/tlist.py
View file @
368fc2cc
...
...
@@ -4,6 +4,8 @@
#
# This test expects Win, Evt and FrameWork (and anything used by those)
# to work.
#
# Actually, it is more a test of FrameWork by now....
from
FrameWork
import
*
import
Win
...
...
@@ -11,49 +13,35 @@ import Qd
import
List
import
os
class
TestList
(
Application
):
def
__init__
(
self
):
os
.
chdir
(
'Moes:'
)
self
.
makemenubar
()
self
.
makewindow
()
def
makewindow
(
self
):
class
ListWindow
(
Window
):
def
open
(
self
,
name
,
where
):
self
.
where
=
where
r
=
(
40
,
40
,
400
,
300
)
w
=
Win
.
NewWindow
(
r
,
"List test"
,
1
,
0
,
-
1
,
1
,
0x55555555
)
w
=
Win
.
NewWindow
(
r
,
name
,
1
,
0
,
-
1
,
1
,
0x55555555
)
r2
=
(
0
,
0
,
345
,
245
)
self
.
list
=
List
.
LNew
(
r2
,
(
0
,
0
,
1
,
1
),
(
0
,
0
),
0
,
w
,
0
,
1
,
1
,
1
)
self
.
filllist
()
w
.
DrawGrowIcon
()
self
.
win
=
w
self
.
wid
=
w
self
.
do_postopen
()
def
makeusermenus
(
self
):
self
.
filemenu
=
m
=
Menu
(
self
.
menubar
,
"File"
)
self
.
quititem
=
MenuItem
(
m
,
"Quit"
,
"Q"
,
self
.
quit
)
def
quit
(
self
,
*
args
):
raise
self
def
do_activate
(
self
,
onoff
,
evt
):
self
.
list
.
LActivate
(
onoff
)
def
do_about
(
self
,
id
,
item
,
window
,
event
):
EasyDialogs
.
Message
(
"""Test the List Manager interface.
Double-click on a folder to change directory"""
)
def
do_activateEvt
(
self
,
*
args
):
self
.
list
.
LActivate
(
1
)
# XXXX Wrong...
def
do_rawupdate
(
self
,
window
,
event
):
window
.
BeginUpdate
()
self
.
do_update
(
window
,
event
)
window
.
EndUpdate
()
def
do_update
(
self
,
*
args
):
print
'LUPDATE'
self
.
list
.
LUpdate
()
def
do_inContent
(
self
,
partcode
,
window
,
event
):
(
what
,
message
,
when
,
where
,
modifiers
)
=
event
Qd
.
SetPort
(
window
)
local
=
Qd
.
GlobalToLocal
(
where
)
print
'CLICK'
,
where
,
'->'
,
local
def
do_contentclick
(
self
,
local
,
modifiers
,
evt
):
dclick
=
self
.
list
.
LClick
(
local
,
modifiers
)
if
dclick
:
h
,
v
=
self
.
list
.
LLastClick
()
file
=
self
.
list
.
LGetCell
(
1000
,
(
h
,
v
))
os
.
chdir
(
file
)
self
.
where
=
os
.
path
.
join
(
self
.
where
,
file
)
self
.
filllist
()
def
filllist
(
self
):
...
...
@@ -61,8 +49,7 @@ class TestList(Application):
l
=
self
.
list
l
.
LSetDrawingMode
(
0
)
l
.
LDelRow
(
0
,
0
)
contents
=
os
.
listdir
(
':'
)
print
contents
contents
=
os
.
listdir
(
self
.
where
)
l
.
LAddRow
(
len
(
contents
),
0
)
for
i
in
range
(
len
(
contents
)):
l
.
LSetCell
(
contents
[
i
],
(
0
,
i
))
...
...
@@ -70,6 +57,34 @@ class TestList(Application):
l
.
LUpdate
()
class
TestList
(
Application
):
def
__init__
(
self
):
Application
.
__init__
(
self
)
self
.
num
=
0
self
.
listoflists
=
[]
def
makeusermenus
(
self
):
self
.
filemenu
=
m
=
Menu
(
self
.
menubar
,
"File"
)
self
.
newitem
=
MenuItem
(
m
,
"New window..."
,
"O"
,
self
.
open
)
self
.
quititem
=
MenuItem
(
m
,
"Quit"
,
"Q"
,
self
.
quit
)
def
open
(
self
,
*
args
):
import
macfs
fss
,
ok
=
macfs
.
GetDirectory
()
if
not
ok
:
return
w
=
ListWindow
(
self
)
w
.
open
(
'Window %d'
%
self
.
num
,
fss
.
as_pathname
())
self
.
num
=
self
.
num
+
1
self
.
listoflists
.
append
(
w
)
def
quit
(
self
,
*
args
):
raise
self
def
do_about
(
self
,
id
,
item
,
window
,
event
):
EasyDialogs
.
Message
(
"""Test the List Manager interface.
Simple inward-only folder browser"""
)
def
main
():
App
=
TestList
()
App
.
mainloop
()
...
...
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