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
c4570487
Commit
c4570487
authored
Mar 20, 1998
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Give in to the tab police.
parent
6f73c1a2
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
286 additions
and
276 deletions
+286
-276
Lib/lib-tk/Canvas.py
Lib/lib-tk/Canvas.py
+18
-18
Lib/lib-tk/FileDialog.py
Lib/lib-tk/FileDialog.py
+163
-163
Lib/lib-tk/SimpleDialog.py
Lib/lib-tk/SimpleDialog.py
+78
-78
Lib/lib-tk/Tkinter.py
Lib/lib-tk/Tkinter.py
+27
-17
No files found.
Lib/lib-tk/Canvas.py
View file @
c4570487
...
@@ -99,11 +99,11 @@ class Oval(CanvasItem):
...
@@ -99,11 +99,11 @@ class Oval(CanvasItem):
class
Polygon
(
CanvasItem
):
class
Polygon
(
CanvasItem
):
def
__init__
(
self
,
canvas
,
*
args
,
**
kw
):
def
__init__
(
self
,
canvas
,
*
args
,
**
kw
):
apply
(
CanvasItem
.
__init__
,
(
self
,
canvas
,
'polygon'
)
+
args
,
kw
)
apply
(
CanvasItem
.
__init__
,
(
self
,
canvas
,
'polygon'
)
+
args
,
kw
)
class
Rectangle
(
CanvasItem
):
class
Rectangle
(
CanvasItem
):
def
__init__
(
self
,
canvas
,
*
args
,
**
kw
):
def
__init__
(
self
,
canvas
,
*
args
,
**
kw
):
apply
(
CanvasItem
.
__init__
,
(
self
,
canvas
,
'rectangle'
)
+
args
,
kw
)
apply
(
CanvasItem
.
__init__
,
(
self
,
canvas
,
'rectangle'
)
+
args
,
kw
)
# XXX "Text" is taken by the Text widget...
# XXX "Text" is taken by the Text widget...
class
CanvasText
(
CanvasItem
):
class
CanvasText
(
CanvasItem
):
...
...
Lib/lib-tk/FileDialog.py
View file @
c4570487
Lib/lib-tk/SimpleDialog.py
View file @
c4570487
Lib/lib-tk/Tkinter.py
View file @
c4570487
...
@@ -51,8 +51,14 @@ def _cnfmerge(cnfs):
...
@@ -51,8 +51,14 @@ def _cnfmerge(cnfs):
class
Event
:
class
Event
:
pass
pass
_support_default_root
=
1
_default_root
=
None
_default_root
=
None
def
NoDefaultRoot
():
global
_support_default_root
_support_default_root
=
0
del
_default_root
def
_tkerror
(
err
):
def
_tkerror
(
err
):
pass
pass
...
@@ -702,6 +708,7 @@ class Misc:
...
@@ -702,6 +708,7 @@ class Misc:
# Support for the "event" command, new in Tk 4.2.
# Support for the "event" command, new in Tk 4.2.
# By Case Roole.
# By Case Roole.
# XXX Why is this using the default root?
def
event_add
(
self
,
virtual
,
*
sequences
):
def
event_add
(
self
,
virtual
,
*
sequences
):
args
=
(
'event'
,
'add'
,
virtual
)
+
sequences
args
=
(
'event'
,
'add'
,
virtual
)
+
sequences
...
@@ -857,14 +864,14 @@ class Tk(Misc, Wm):
...
@@ -857,14 +864,14 @@ class Tk(Misc, Wm):
self
.
tk
.
createcommand
(
'tkerror'
,
_tkerror
)
self
.
tk
.
createcommand
(
'tkerror'
,
_tkerror
)
self
.
tk
.
createcommand
(
'exit'
,
_exit
)
self
.
tk
.
createcommand
(
'exit'
,
_exit
)
self
.
readprofile
(
baseName
,
className
)
self
.
readprofile
(
baseName
,
className
)
if
not
_default_root
:
if
_support_default_root
and
not
_default_root
:
_default_root
=
self
_default_root
=
self
def
destroy
(
self
):
def
destroy
(
self
):
for
c
in
self
.
children
.
values
():
c
.
destroy
()
for
c
in
self
.
children
.
values
():
c
.
destroy
()
self
.
tk
.
call
(
'destroy'
,
self
.
_w
)
self
.
tk
.
call
(
'destroy'
,
self
.
_w
)
Misc
.
destroy
(
self
)
Misc
.
destroy
(
self
)
global
_default_root
global
_default_root
if
_default_root
is
self
:
if
_
support_default_root
and
_
default_root
is
self
:
_default_root
=
None
_default_root
=
None
def
readprofile
(
self
,
baseName
,
className
):
def
readprofile
(
self
,
baseName
,
className
):
import
os
import
os
...
@@ -994,6 +1001,7 @@ class Grid:
...
@@ -994,6 +1001,7 @@ class Grid:
class
BaseWidget
(
Misc
):
class
BaseWidget
(
Misc
):
def
_setup
(
self
,
master
,
cnf
):
def
_setup
(
self
,
master
,
cnf
):
if
_support_default_root
:
global
_default_root
global
_default_root
if
not
master
:
if
not
master
:
if
not
_default_root
:
if
not
_default_root
:
...
@@ -1693,10 +1701,12 @@ class OptionMenu(Menubutton):
...
@@ -1693,10 +1701,12 @@ class OptionMenu(Menubutton):
self
.
__menu
=
None
self
.
__menu
=
None
class
Image
:
class
Image
:
def
__init__
(
self
,
imgtype
,
name
=
None
,
cnf
=
{},
**
kw
):
def
__init__
(
self
,
imgtype
,
name
=
None
,
cnf
=
{},
master
=
None
,
**
kw
):
self
.
name
=
None
self
.
name
=
None
if
not
master
:
master
=
_default_root
master
=
_default_root
if
not
master
:
raise
RuntimeError
,
'Too early to create image'
if
not
master
:
raise
RuntimeError
,
'Too early to create image'
self
.
tk
=
master
.
tk
self
.
tk
=
master
.
tk
if
not
name
:
if
not
name
:
name
=
`id(self)`
name
=
`id(self)`
...
@@ -1741,8 +1751,8 @@ class Image:
...
@@ -1741,8 +1751,8 @@ class Image:
self
.
tk
.
call
(
'image'
,
'width'
,
self
.
name
))
self
.
tk
.
call
(
'image'
,
'width'
,
self
.
name
))
class
PhotoImage
(
Image
):
class
PhotoImage
(
Image
):
def
__init__
(
self
,
name
=
None
,
cnf
=
{},
**
kw
):
def
__init__
(
self
,
name
=
None
,
cnf
=
{},
master
=
None
,
**
kw
):
apply
(
Image
.
__init__
,
(
self
,
'photo'
,
name
,
cnf
),
kw
)
apply
(
Image
.
__init__
,
(
self
,
'photo'
,
name
,
cnf
,
master
),
kw
)
def
blank
(
self
):
def
blank
(
self
):
self
.
tk
.
call
(
self
.
name
,
'blank'
)
self
.
tk
.
call
(
self
.
name
,
'blank'
)
def
cget
(
self
,
option
):
def
cget
(
self
,
option
):
...
@@ -1784,8 +1794,8 @@ class PhotoImage(Image):
...
@@ -1784,8 +1794,8 @@ class PhotoImage(Image):
apply
(
self
.
tk
.
call
,
args
)
apply
(
self
.
tk
.
call
,
args
)
class
BitmapImage
(
Image
):
class
BitmapImage
(
Image
):
def
__init__
(
self
,
name
=
None
,
cnf
=
{},
**
kw
):
def
__init__
(
self
,
name
=
None
,
cnf
=
{},
master
=
None
,
**
kw
):
apply
(
Image
.
__init__
,
(
self
,
'bitmap'
,
name
,
cnf
),
kw
)
apply
(
Image
.
__init__
,
(
self
,
'bitmap'
,
name
,
cnf
,
master
),
kw
)
def
image_names
():
return
_default_root
.
tk
.
call
(
'image'
,
'names'
)
def
image_names
():
return
_default_root
.
tk
.
call
(
'image'
,
'names'
)
def
image_types
():
return
_default_root
.
tk
.
call
(
'image'
,
'types'
)
def
image_types
():
return
_default_root
.
tk
.
call
(
'image'
,
'types'
)
...
...
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