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
fb9149c4
Kaydet (Commit)
fb9149c4
authored
Nis 21, 1991
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Support delayed destroy. Use built-in remove.
Dispatch needn't check for win = self.win.
üst
a82a2758
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
16 deletions
+30
-16
WindowParent.py
Lib/lib-stdwin/WindowParent.py
+15
-8
WindowParent.py
Lib/stdwin/WindowParent.py
+15
-8
No files found.
Lib/lib-stdwin/WindowParent.py
Dosyayı görüntüle @
fb9149c4
...
...
@@ -29,14 +29,20 @@ class WindowParent() = ManageOneChild():
self
.
do_keybd
=
0
self
.
do_timer
=
0
self
.
do_altdraw
=
0
self
.
pending_destroy
=
0
#
def
destroy
(
self
):
if
self
.
win
in
WindowList
:
import
util
util
.
remove
(
self
.
win
,
WindowList
)
WindowList
.
remove
(
self
.
win
)
if
self
.
child
:
self
.
child
.
destroy
()
self
.
_reset
()
#
def
delayed_destroy
(
self
):
# This interface to be used by 'Close' buttons etc.;
# destroying a window from within a button hook
# is not a good idea...
self
.
pending_destroy
=
1
#
def
need_mouse
(
self
,
child
):
self
.
do_mouse
=
1
def
no_mouse
(
self
,
child
):
self
.
do_mouse
=
0
#
...
...
@@ -57,9 +63,10 @@ class WindowParent() = ManageOneChild():
size
=
self
.
child
.
minsize
(
self
.
beginmeasuring
())
self
.
size
=
max
(
self
.
size
[
0
],
size
[
0
]),
\
max
(
self
.
size
[
1
],
size
[
1
])
# XXX stdwin.setdefwinsize(self.size
)
stdwin
.
setdefscrollbars
(
0
,
0
)
# XXX Compensate stdwin bug:
stdwin
.
setdefwinsize
(
self
.
size
[
0
]
+
4
,
min
(
300
,
self
.
size
[
1
]
+
2
))
# XXX should really be stdwin.setdefwinsize(self.size)
stdwin
.
setdefwinsize
(
self
.
size
[
0
]
+
4
,
self
.
size
[
1
]
+
2
)
self
.
win
=
stdwin
.
open
(
self
.
title
)
self
.
win
.
setdocsize
(
self
.
size
)
if
self
.
itimer
:
...
...
@@ -109,12 +116,10 @@ class WindowParent() = ManageOneChild():
else
:
self
.
itimer
=
itimer
#
# Only call dispatch
if we have a chil
d
# Only call dispatch
once we are realize
d
#
def
dispatch
(
self
,
(
type
,
win
,
detail
)):
if
win
<>
self
.
win
:
return
elif
type
=
WE_DRAW
:
if
type
=
WE_DRAW
:
d
=
self
.
win
.
begindrawing
()
self
.
child
.
draw
(
d
,
detail
)
del
d
...
...
@@ -132,6 +137,8 @@ class WindowParent() = ManageOneChild():
elif
type
=
WE_SIZE
:
self
.
fixup
()
elif
type
=
WE_CLOSE
:
self
.
delayed_destroy
()
if
self
.
pending_destroy
:
self
.
destroy
()
#
...
...
Lib/stdwin/WindowParent.py
Dosyayı görüntüle @
fb9149c4
...
...
@@ -29,14 +29,20 @@ class WindowParent() = ManageOneChild():
self
.
do_keybd
=
0
self
.
do_timer
=
0
self
.
do_altdraw
=
0
self
.
pending_destroy
=
0
#
def
destroy
(
self
):
if
self
.
win
in
WindowList
:
import
util
util
.
remove
(
self
.
win
,
WindowList
)
WindowList
.
remove
(
self
.
win
)
if
self
.
child
:
self
.
child
.
destroy
()
self
.
_reset
()
#
def
delayed_destroy
(
self
):
# This interface to be used by 'Close' buttons etc.;
# destroying a window from within a button hook
# is not a good idea...
self
.
pending_destroy
=
1
#
def
need_mouse
(
self
,
child
):
self
.
do_mouse
=
1
def
no_mouse
(
self
,
child
):
self
.
do_mouse
=
0
#
...
...
@@ -57,9 +63,10 @@ class WindowParent() = ManageOneChild():
size
=
self
.
child
.
minsize
(
self
.
beginmeasuring
())
self
.
size
=
max
(
self
.
size
[
0
],
size
[
0
]),
\
max
(
self
.
size
[
1
],
size
[
1
])
# XXX stdwin.setdefwinsize(self.size
)
stdwin
.
setdefscrollbars
(
0
,
0
)
# XXX Compensate stdwin bug:
stdwin
.
setdefwinsize
(
self
.
size
[
0
]
+
4
,
min
(
300
,
self
.
size
[
1
]
+
2
))
# XXX should really be stdwin.setdefwinsize(self.size)
stdwin
.
setdefwinsize
(
self
.
size
[
0
]
+
4
,
self
.
size
[
1
]
+
2
)
self
.
win
=
stdwin
.
open
(
self
.
title
)
self
.
win
.
setdocsize
(
self
.
size
)
if
self
.
itimer
:
...
...
@@ -109,12 +116,10 @@ class WindowParent() = ManageOneChild():
else
:
self
.
itimer
=
itimer
#
# Only call dispatch
if we have a chil
d
# Only call dispatch
once we are realize
d
#
def
dispatch
(
self
,
(
type
,
win
,
detail
)):
if
win
<>
self
.
win
:
return
elif
type
=
WE_DRAW
:
if
type
=
WE_DRAW
:
d
=
self
.
win
.
begindrawing
()
self
.
child
.
draw
(
d
,
detail
)
del
d
...
...
@@ -132,6 +137,8 @@ class WindowParent() = ManageOneChild():
elif
type
=
WE_SIZE
:
self
.
fixup
()
elif
type
=
WE_CLOSE
:
self
.
delayed_destroy
()
if
self
.
pending_destroy
:
self
.
destroy
()
#
...
...
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