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
4435d5a8
Kaydet (Commit)
4435d5a8
authored
Şub 18, 1998
tarafından
Barry Warsaw
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Very modest improvements
üst
49c5b0d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
27 deletions
+31
-27
StripViewer.py
Tools/pynche/StripViewer.py
+31
-27
No files found.
Tools/pynche/StripViewer.py
Dosyayı görüntüle @
4435d5a8
...
@@ -113,7 +113,7 @@ class StripWidget(Pmw.MegaWidget):
...
@@ -113,7 +113,7 @@ class StripWidget(Pmw.MegaWidget):
canvasheight
=
chipheight
+
43
# TBD: Kludge
canvasheight
=
chipheight
+
43
# TBD: Kludge
# create the canvas and pack it
# create the canvas and pack it
self
.
__canvas
=
Canvas
(
canvas
=
self
.
__canvas
=
Canvas
(
parent
,
parent
,
width
=
canvaswidth
,
width
=
canvaswidth
,
height
=
canvasheight
,
height
=
canvasheight
,
...
@@ -121,41 +121,41 @@ class StripWidget(Pmw.MegaWidget):
...
@@ -121,41 +121,41 @@ class StripWidget(Pmw.MegaWidget):
## relief=GROOVE
## relief=GROOVE
)
)
self
.
__canvas
.
pack
()
canvas
.
pack
()
self
.
__canvas
.
bind
(
'<ButtonRelease-1>'
,
canvas
.
bind
(
'<ButtonRelease-1>'
,
self
.
__select_chip
)
self
.
__select_chip
)
canvas
.
bind
(
'<B1-Motion>'
,
self
.
__select_chip
)
self
.
__canvas
.
bind
(
'<B1-Motion>'
,
self
.
__select_chip
)
# Load a proc into the Tcl interpreter. This is used in the
# Load a proc into the Tcl interpreter. This is used in the
# set_color() method to speed up setting the chip colors.
# set_color() method to speed up setting the chip colors.
self
.
__
canvas
.
tk
.
eval
(
TCLPROC
)
canvas
.
tk
.
eval
(
TCLPROC
)
# create the color strip
# create the color strip
chips
=
self
.
__chips
=
[]
chips
=
self
.
__chips
=
[]
x
=
1
x
=
1
y
=
30
y
=
30
tags
=
(
'chip'
,)
for
c
in
range
(
self
.
__numchips
):
for
c
in
range
(
self
.
__numchips
):
color
=
'grey'
color
=
'grey'
rect
=
self
.
__
canvas
.
create_rectangle
(
rect
=
canvas
.
create_rectangle
(
x
,
y
,
x
+
chipwidth
,
y
+
chipheight
,
x
,
y
,
x
+
chipwidth
,
y
+
chipheight
,
fill
=
color
,
outline
=
color
)
fill
=
color
,
outline
=
color
,
tags
=
tags
)
x
=
x
+
chipwidth
+
1
# for outline
x
=
x
+
chipwidth
+
1
# for outline
chips
.
append
(
color
)
chips
.
append
(
color
)
# create the string tag
# create the string tag
self
.
__label
=
self
.
__
canvas
.
create_text
(
self
.
__label
=
canvas
.
create_text
(
3
,
y
+
chipheight
+
8
,
3
,
y
+
chipheight
+
8
,
text
=
self
[
'label'
],
text
=
self
[
'label'
],
anchor
=
W
)
anchor
=
W
)
# create the arrow and text item
# create the arrow and text item
chipx
=
self
.
__arrow_x
(
0
)
chipx
=
self
.
__arrow_x
(
0
)
self
.
__leftarrow
=
LeftArrow
(
self
.
__
canvas
,
chipx
)
self
.
__leftarrow
=
LeftArrow
(
canvas
,
chipx
)
chipx
=
self
.
__arrow_x
(
len
(
chips
)
-
1
)
chipx
=
self
.
__arrow_x
(
len
(
chips
)
-
1
)
self
.
__rightarrow
=
RightArrow
(
self
.
__
canvas
,
chipx
)
self
.
__rightarrow
=
RightArrow
(
canvas
,
chipx
)
self
.
__generator
=
self
[
'generator'
]
self
.
__generator
=
self
[
'generator'
]
self
.
__axis
=
self
[
'axis'
]
self
.
__axis
=
self
[
'axis'
]
...
@@ -174,21 +174,25 @@ class StripWidget(Pmw.MegaWidget):
...
@@ -174,21 +174,25 @@ class StripWidget(Pmw.MegaWidget):
return
(
x1
+
x0
)
/
2.0
return
(
x1
+
x0
)
/
2.0
def
__select_chip
(
self
,
event
=
None
):
def
__select_chip
(
self
,
event
=
None
):
chip
=
self
.
__canvas
.
find_closest
(
event
.
x
,
event
.
y
)[
0
]
if
self
.
__delegate
:
if
chip
and
self
.
__delegate
:
x
=
event
.
x
color
=
self
.
__chips
[
chip
-
1
]
y
=
event
.
y
rgbtuple
=
ColorDB
.
rrggbb_to_triplet
(
color
)
canvas
=
self
.
__canvas
self
.
__delegate
.
set_color
(
self
,
rgbtuple
)
chip
=
canvas
.
find_overlapping
(
x
,
y
,
x
,
y
)
if
chip
and
(
1
<=
chip
[
0
]
<=
self
.
__numchips
):
## import profile
color
=
self
.
__chips
[
chip
[
0
]
-
1
]
## import pstats
rgbtuple
=
ColorDB
.
rrggbb_to_triplet
(
color
)
## import tempfile
## statfile = tempfile.mktemp()
self
.
__delegate
.
set_color
(
self
,
rgbtuple
)
## p = profile.Profile()
## import profile
## p.runcall(self.__delegate.set_color, self, rgbtuple)
## import pstats
## p.dump_stats(statfile)
## import tempfile
## s = pstats.Stats(statfile)
## statfile = tempfile.mktemp()
## s.strip_dirs().sort_stats('time').print_stats(10)
## p = profile.Profile()
## p.runcall(self.__delegate.set_color, self, rgbtuple)
## p.dump_stats(statfile)
## s = pstats.Stats(statfile)
## s.strip_dirs().sort_stats('time').print_stats(10)
def
__set_delegate
(
self
):
def
__set_delegate
(
self
):
self
.
__delegate
=
self
[
'delegate'
]
self
.
__delegate
=
self
[
'delegate'
]
...
...
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