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
1530c879
Kaydet (Commit)
1530c879
authored
Agu 14, 1997
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fred Lundh's latest versions.
üst
f53c86c2
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
22 deletions
+42
-22
tkColorChooser.py
Lib/lib-tk/tkColorChooser.py
+2
-1
tkCommonDialog.py
Lib/lib-tk/tkCommonDialog.py
+2
-1
tkSimpleDialog.py
Lib/lib-tk/tkSimpleDialog.py
+17
-9
tkColorChooser.py
Lib/tkinter/tkColorChooser.py
+2
-1
tkCommonDialog.py
Lib/tkinter/tkCommonDialog.py
+2
-1
tkSimpleDialog.py
Lib/tkinter/tkSimpleDialog.py
+17
-9
No files found.
Lib/lib-tk/tkColorChooser.py
Dosyayı görüntüle @
1530c879
...
...
@@ -22,7 +22,7 @@
#
# FIXME: as of Tk 8.0a2, the Unix colour picker is really ugly, and
# doesn't seem to work properly on
a true colour display
. maybe we
# doesn't seem to work properly on
true colour displays
. maybe we
# should use the instant python version instead?
from
tkCommonDialog
import
Dialog
...
...
@@ -70,3 +70,4 @@ def askcolor(color = None, **options):
if
__name__
==
"__main__"
:
print
"color"
,
askcolor
()
Lib/lib-tk/tkCommonDialog.py
Dosyayı görüntüle @
1530c879
...
...
@@ -42,7 +42,7 @@ class Dialog:
self
.
_fixoptions
()
# we need a
stub
widget to properly process the options
# we need a
dummy
widget to properly process the options
# (at least as long as we use Tkinter 1.63)
w
=
Frame
(
self
.
master
)
...
...
@@ -61,3 +61,4 @@ class Dialog:
pass
return
s
Lib/lib-tk/tkSimpleDialog.py
Dosyayı görüntüle @
1530c879
...
...
@@ -115,6 +115,7 @@ import string
class
_QueryDialog
(
Dialog
):
def
__init__
(
self
,
title
,
prompt
,
initialvalue
=
None
,
minvalue
=
None
,
maxvalue
=
None
,
parent
=
None
):
...
...
@@ -127,16 +128,22 @@ class _QueryDialog(Dialog):
self
.
minvalue
=
minvalue
self
.
maxvalue
=
maxvalue
self
.
initialvalue
=
initialvalue
Dialog
.
__init__
(
self
,
parent
,
title
)
def
body
(
self
,
master
):
w
=
Label
(
master
,
text
=
self
.
prompt
)
w
=
Label
(
master
,
text
=
self
.
prompt
,
justify
=
LEFT
)
w
.
grid
(
row
=
0
,
padx
=
5
,
sticky
=
W
)
self
.
entry
=
Entry
(
master
,
name
=
"entry"
)
self
.
entry
.
grid
(
row
=
1
,
padx
=
5
,
sticky
=
W
+
E
)
if
self
.
initialvalue
:
self
.
entry
.
insert
(
0
,
self
.
initialvalue
)
self
.
entry
.
select_range
(
0
,
END
)
return
self
.
entry
def
validate
(
self
):
...
...
@@ -147,7 +154,7 @@ class _QueryDialog(Dialog):
result
=
self
.
getresult
()
except
ValueError
:
tkMessageBox
.
showwarning
(
"
Bad
value"
,
"
Illegal
value"
,
self
.
errormessage
+
"
\n
Please try again"
,
parent
=
self
)
...
...
@@ -157,16 +164,16 @@ class _QueryDialog(Dialog):
tkMessageBox
.
showwarning
(
"Too small"
,
"The allowed minimum value is
%
s. "
"Please try again"
%
self
.
minvalue
,
"Please try again
.
"
%
self
.
minvalue
,
parent
=
self
)
return
0
if
self
.
maxvalue
is
not
None
and
result
>
self
.
maxvalue
:
tkMessageBox
.
showwarning
(
"
Bad valu
e"
,
"
Too larg
e"
,
"The allowed maximum value is
%
s. "
"Please try again"
%
self
.
maxvalue
,
"Please try again
.
"
%
self
.
maxvalue
,
parent
=
self
)
return
0
...
...
@@ -177,7 +184,7 @@ class _QueryDialog(Dialog):
class
_QueryInteger
(
_QueryDialog
):
errormessage
=
"
Invalid integer
"
errormessage
=
"
Not an integer.
"
def
getresult
(
self
):
return
string
.
atoi
(
self
.
entry
.
get
())
...
...
@@ -186,7 +193,7 @@ def askinteger(title, prompt, **kw):
return
d
.
result
class
_QueryFloat
(
_QueryDialog
):
errormessage
=
"
Invalid floating point value
"
errormessage
=
"
Not a floating point value.
"
def
getresult
(
self
):
return
string
.
atof
(
self
.
entry
.
get
())
...
...
@@ -207,6 +214,7 @@ if __name__ == "__main__":
root
=
Tk
()
root
.
update
()
print
askinteger
(
"Spam"
,
"Egg count"
)
print
askfloat
(
"Spam"
,
"Egg weight
"
)
print
askinteger
(
"Spam"
,
"Egg count"
,
initialvalue
=
12
*
12
)
print
askfloat
(
"Spam"
,
"Egg weight
\n
(in tons)"
,
minvalue
=
1
,
maxvalue
=
100
)
print
askstring
(
"Spam"
,
"Egg label"
)
Lib/tkinter/tkColorChooser.py
Dosyayı görüntüle @
1530c879
...
...
@@ -22,7 +22,7 @@
#
# FIXME: as of Tk 8.0a2, the Unix colour picker is really ugly, and
# doesn't seem to work properly on
a true colour display
. maybe we
# doesn't seem to work properly on
true colour displays
. maybe we
# should use the instant python version instead?
from
tkCommonDialog
import
Dialog
...
...
@@ -70,3 +70,4 @@ def askcolor(color = None, **options):
if
__name__
==
"__main__"
:
print
"color"
,
askcolor
()
Lib/tkinter/tkCommonDialog.py
Dosyayı görüntüle @
1530c879
...
...
@@ -42,7 +42,7 @@ class Dialog:
self
.
_fixoptions
()
# we need a
stub
widget to properly process the options
# we need a
dummy
widget to properly process the options
# (at least as long as we use Tkinter 1.63)
w
=
Frame
(
self
.
master
)
...
...
@@ -61,3 +61,4 @@ class Dialog:
pass
return
s
Lib/tkinter/tkSimpleDialog.py
Dosyayı görüntüle @
1530c879
...
...
@@ -115,6 +115,7 @@ import string
class
_QueryDialog
(
Dialog
):
def
__init__
(
self
,
title
,
prompt
,
initialvalue
=
None
,
minvalue
=
None
,
maxvalue
=
None
,
parent
=
None
):
...
...
@@ -127,16 +128,22 @@ class _QueryDialog(Dialog):
self
.
minvalue
=
minvalue
self
.
maxvalue
=
maxvalue
self
.
initialvalue
=
initialvalue
Dialog
.
__init__
(
self
,
parent
,
title
)
def
body
(
self
,
master
):
w
=
Label
(
master
,
text
=
self
.
prompt
)
w
=
Label
(
master
,
text
=
self
.
prompt
,
justify
=
LEFT
)
w
.
grid
(
row
=
0
,
padx
=
5
,
sticky
=
W
)
self
.
entry
=
Entry
(
master
,
name
=
"entry"
)
self
.
entry
.
grid
(
row
=
1
,
padx
=
5
,
sticky
=
W
+
E
)
if
self
.
initialvalue
:
self
.
entry
.
insert
(
0
,
self
.
initialvalue
)
self
.
entry
.
select_range
(
0
,
END
)
return
self
.
entry
def
validate
(
self
):
...
...
@@ -147,7 +154,7 @@ class _QueryDialog(Dialog):
result
=
self
.
getresult
()
except
ValueError
:
tkMessageBox
.
showwarning
(
"
Bad
value"
,
"
Illegal
value"
,
self
.
errormessage
+
"
\n
Please try again"
,
parent
=
self
)
...
...
@@ -157,16 +164,16 @@ class _QueryDialog(Dialog):
tkMessageBox
.
showwarning
(
"Too small"
,
"The allowed minimum value is
%
s. "
"Please try again"
%
self
.
minvalue
,
"Please try again
.
"
%
self
.
minvalue
,
parent
=
self
)
return
0
if
self
.
maxvalue
is
not
None
and
result
>
self
.
maxvalue
:
tkMessageBox
.
showwarning
(
"
Bad valu
e"
,
"
Too larg
e"
,
"The allowed maximum value is
%
s. "
"Please try again"
%
self
.
maxvalue
,
"Please try again
.
"
%
self
.
maxvalue
,
parent
=
self
)
return
0
...
...
@@ -177,7 +184,7 @@ class _QueryDialog(Dialog):
class
_QueryInteger
(
_QueryDialog
):
errormessage
=
"
Invalid integer
"
errormessage
=
"
Not an integer.
"
def
getresult
(
self
):
return
string
.
atoi
(
self
.
entry
.
get
())
...
...
@@ -186,7 +193,7 @@ def askinteger(title, prompt, **kw):
return
d
.
result
class
_QueryFloat
(
_QueryDialog
):
errormessage
=
"
Invalid floating point value
"
errormessage
=
"
Not a floating point value.
"
def
getresult
(
self
):
return
string
.
atof
(
self
.
entry
.
get
())
...
...
@@ -207,6 +214,7 @@ if __name__ == "__main__":
root
=
Tk
()
root
.
update
()
print
askinteger
(
"Spam"
,
"Egg count"
)
print
askfloat
(
"Spam"
,
"Egg weight
"
)
print
askinteger
(
"Spam"
,
"Egg count"
,
initialvalue
=
12
*
12
)
print
askfloat
(
"Spam"
,
"Egg weight
\n
(in tons)"
,
minvalue
=
1
,
maxvalue
=
100
)
print
askstring
(
"Spam"
,
"Egg label"
)
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