Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
b4e47839
Kaydet (Commit)
b4e47839
authored
Agu 17, 1995
tarafından
Jack Jansen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Uses new FrameWork, has multiple windows
üst
8ce4d510
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
31 deletions
+46
-31
tlist.py
Mac/Lib/test/tlist.py
+46
-31
No files found.
Mac/Lib/test/tlist.py
Dosyayı görüntüle @
b4e47839
...
@@ -4,6 +4,8 @@
...
@@ -4,6 +4,8 @@
#
#
# This test expects Win, Evt and FrameWork (and anything used by those)
# This test expects Win, Evt and FrameWork (and anything used by those)
# to work.
# to work.
#
# Actually, it is more a test of FrameWork by now....
from
FrameWork
import
*
from
FrameWork
import
*
import
Win
import
Win
...
@@ -11,49 +13,35 @@ import Qd
...
@@ -11,49 +13,35 @@ import Qd
import
List
import
List
import
os
import
os
class
TestList
(
Application
):
class
ListWindow
(
Window
):
def
__init__
(
self
):
def
open
(
self
,
name
,
where
):
os
.
chdir
(
'Moes:'
)
self
.
where
=
where
self
.
makemenubar
()
self
.
makewindow
()
def
makewindow
(
self
):
r
=
(
40
,
40
,
400
,
300
)
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
)
r2
=
(
0
,
0
,
345
,
245
)
self
.
list
=
List
.
LNew
(
r2
,
(
0
,
0
,
1
,
1
),
(
0
,
0
),
0
,
w
,
0
,
1
,
1
,
1
)
self
.
list
=
List
.
LNew
(
r2
,
(
0
,
0
,
1
,
1
),
(
0
,
0
),
0
,
w
,
0
,
1
,
1
,
1
)
self
.
filllist
()
self
.
filllist
()
w
.
DrawGrowIcon
()
w
.
DrawGrowIcon
()
self
.
win
=
w
self
.
wid
=
w
self
.
do_postopen
()
def
makeusermenus
(
self
):
def
do_activate
(
self
,
onoff
,
evt
):
self
.
filemenu
=
m
=
Menu
(
self
.
menubar
,
"File"
)
self
.
list
.
LActivate
(
onoff
)
self
.
quititem
=
MenuItem
(
m
,
"Quit"
,
"Q"
,
self
.
quit
)
def
quit
(
self
,
*
args
):
raise
self
def
do_about
(
self
,
id
,
item
,
window
,
event
):
def
do_rawupdate
(
self
,
window
,
event
):
EasyDialogs
.
Message
(
"""Test the List Manager interface.
window
.
BeginUpdate
()
Double-click on a folder to change directory"""
)
self
.
do_update
(
window
,
event
)
window
.
EndUpdate
()
def
do_activateEvt
(
self
,
*
args
):
self
.
list
.
LActivate
(
1
)
# XXXX Wrong...
def
do_update
(
self
,
*
args
):
def
do_update
(
self
,
*
args
):
print
'LUPDATE'
self
.
list
.
LUpdate
()
self
.
list
.
LUpdate
()
def
do_inContent
(
self
,
partcode
,
window
,
event
):
def
do_contentclick
(
self
,
local
,
modifiers
,
evt
):
(
what
,
message
,
when
,
where
,
modifiers
)
=
event
Qd
.
SetPort
(
window
)
local
=
Qd
.
GlobalToLocal
(
where
)
print
'CLICK'
,
where
,
'->'
,
local
dclick
=
self
.
list
.
LClick
(
local
,
modifiers
)
dclick
=
self
.
list
.
LClick
(
local
,
modifiers
)
if
dclick
:
if
dclick
:
h
,
v
=
self
.
list
.
LLastClick
()
h
,
v
=
self
.
list
.
LLastClick
()
file
=
self
.
list
.
LGetCell
(
1000
,
(
h
,
v
))
file
=
self
.
list
.
LGetCell
(
1000
,
(
h
,
v
))
os
.
chdir
(
file
)
self
.
where
=
os
.
path
.
join
(
self
.
where
,
file
)
self
.
filllist
()
self
.
filllist
()
def
filllist
(
self
):
def
filllist
(
self
):
...
@@ -61,8 +49,7 @@ class TestList(Application):
...
@@ -61,8 +49,7 @@ class TestList(Application):
l
=
self
.
list
l
=
self
.
list
l
.
LSetDrawingMode
(
0
)
l
.
LSetDrawingMode
(
0
)
l
.
LDelRow
(
0
,
0
)
l
.
LDelRow
(
0
,
0
)
contents
=
os
.
listdir
(
':'
)
contents
=
os
.
listdir
(
self
.
where
)
print
contents
l
.
LAddRow
(
len
(
contents
),
0
)
l
.
LAddRow
(
len
(
contents
),
0
)
for
i
in
range
(
len
(
contents
)):
for
i
in
range
(
len
(
contents
)):
l
.
LSetCell
(
contents
[
i
],
(
0
,
i
))
l
.
LSetCell
(
contents
[
i
],
(
0
,
i
))
...
@@ -70,6 +57,34 @@ class TestList(Application):
...
@@ -70,6 +57,34 @@ class TestList(Application):
l
.
LUpdate
()
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
():
def
main
():
App
=
TestList
()
App
=
TestList
()
App
.
mainloop
()
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