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
32be6236
Commit
32be6236
authored
May 14, 1991
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
parent
f7c8e235
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
16 deletions
+24
-16
Lib/lib-stdwin/TextEdit.py
Lib/lib-stdwin/TextEdit.py
+1
-1
Lib/lib-stdwin/WindowParent.py
Lib/lib-stdwin/WindowParent.py
+11
-7
Lib/stdwin/TextEdit.py
Lib/stdwin/TextEdit.py
+1
-1
Lib/stdwin/WindowParent.py
Lib/stdwin/WindowParent.py
+11
-7
No files found.
Lib/lib-stdwin/TextEdit.py
View file @
32be6236
...
...
@@ -25,7 +25,7 @@ class TextEdit():
del
self
.
window
#
def
minsize
(
self
,
m
):
return
self
.
cols
*
m
.
textwidth
(
'
n'
)
,
self
.
rows
*
m
.
lineheight
()
return
self
.
cols
*
m
.
textwidth
(
'
in'
)
/
2
,
self
.
rows
*
m
.
lineheight
()
def
setbounds
(
self
,
bounds
):
self
.
bounds
=
bounds
if
self
.
editor
:
...
...
Lib/lib-stdwin/WindowParent.py
View file @
32be6236
...
...
@@ -22,14 +22,15 @@ class WindowParent() = ManageOneChild():
return
self
#
def
_reset
(
self
):
self
.
child
=
0
self
.
win
=
0
self
.
child
=
None
self
.
win
=
None
self
.
itimer
=
0
self
.
do_mouse
=
0
self
.
do_keybd
=
0
self
.
do_timer
=
0
self
.
do_altdraw
=
0
self
.
pending_destroy
=
0
self
.
close_hook
=
None
#
def
destroy
(
self
):
if
self
.
win
in
WindowList
:
...
...
@@ -43,6 +44,9 @@ class WindowParent() = ManageOneChild():
# is not a good idea...
self
.
pending_destroy
=
1
#
def
close_trigger
(
self
):
if
self
.
close_hook
:
self
.
close_hook
(
self
)
#
def
need_mouse
(
self
,
child
):
self
.
do_mouse
=
1
def
no_mouse
(
self
,
child
):
self
.
do_mouse
=
0
#
...
...
@@ -63,10 +67,8 @@ class WindowParent() = ManageOneChild():
size
=
self
.
child
.
minsize
(
self
.
beginmeasuring
())
self
.
size
=
max
(
self
.
size
[
0
],
size
[
0
]),
\
max
(
self
.
size
[
1
],
size
[
1
])
stdwin
.
setdefscrollbars
(
0
,
0
)
# XXX Compensate stdwin bug:
# XXX should really be stdwin.setdefwinsize(self.size)
stdwin
.
setdefwinsize
(
self
.
size
[
0
]
+
4
,
self
.
size
[
1
]
+
2
)
# XXX Don't... stdwin.setdefscrollbars(0, 0)
stdwin
.
setdefwinsize
(
self
.
size
)
self
.
win
=
stdwin
.
open
(
self
.
title
)
self
.
win
.
setdocsize
(
self
.
size
)
if
self
.
itimer
:
...
...
@@ -82,6 +84,8 @@ class WindowParent() = ManageOneChild():
self
.
win
.
setdocsize
(
self
.
size
)
bounds
=
(
0
,
0
),
self
.
win
.
getwinsize
()
self
.
child
.
setbounds
(
bounds
)
# Force a redraw of the entire window:
self
.
win
.
change
((
0
,
0
),
(
10000
,
10000
))
#
def
beginmeasuring
(
self
):
# Return something with which a child can measure text
...
...
@@ -137,7 +141,7 @@ class WindowParent() = ManageOneChild():
elif
type
=
WE_SIZE
:
self
.
fixup
()
elif
type
=
WE_CLOSE
:
self
.
delayed_destroy
()
self
.
close_trigger
()
if
self
.
pending_destroy
:
self
.
destroy
()
#
...
...
Lib/stdwin/TextEdit.py
View file @
32be6236
...
...
@@ -25,7 +25,7 @@ class TextEdit():
del
self
.
window
#
def
minsize
(
self
,
m
):
return
self
.
cols
*
m
.
textwidth
(
'
n'
)
,
self
.
rows
*
m
.
lineheight
()
return
self
.
cols
*
m
.
textwidth
(
'
in'
)
/
2
,
self
.
rows
*
m
.
lineheight
()
def
setbounds
(
self
,
bounds
):
self
.
bounds
=
bounds
if
self
.
editor
:
...
...
Lib/stdwin/WindowParent.py
View file @
32be6236
...
...
@@ -22,14 +22,15 @@ class WindowParent() = ManageOneChild():
return
self
#
def
_reset
(
self
):
self
.
child
=
0
self
.
win
=
0
self
.
child
=
None
self
.
win
=
None
self
.
itimer
=
0
self
.
do_mouse
=
0
self
.
do_keybd
=
0
self
.
do_timer
=
0
self
.
do_altdraw
=
0
self
.
pending_destroy
=
0
self
.
close_hook
=
None
#
def
destroy
(
self
):
if
self
.
win
in
WindowList
:
...
...
@@ -43,6 +44,9 @@ class WindowParent() = ManageOneChild():
# is not a good idea...
self
.
pending_destroy
=
1
#
def
close_trigger
(
self
):
if
self
.
close_hook
:
self
.
close_hook
(
self
)
#
def
need_mouse
(
self
,
child
):
self
.
do_mouse
=
1
def
no_mouse
(
self
,
child
):
self
.
do_mouse
=
0
#
...
...
@@ -63,10 +67,8 @@ class WindowParent() = ManageOneChild():
size
=
self
.
child
.
minsize
(
self
.
beginmeasuring
())
self
.
size
=
max
(
self
.
size
[
0
],
size
[
0
]),
\
max
(
self
.
size
[
1
],
size
[
1
])
stdwin
.
setdefscrollbars
(
0
,
0
)
# XXX Compensate stdwin bug:
# XXX should really be stdwin.setdefwinsize(self.size)
stdwin
.
setdefwinsize
(
self
.
size
[
0
]
+
4
,
self
.
size
[
1
]
+
2
)
# XXX Don't... stdwin.setdefscrollbars(0, 0)
stdwin
.
setdefwinsize
(
self
.
size
)
self
.
win
=
stdwin
.
open
(
self
.
title
)
self
.
win
.
setdocsize
(
self
.
size
)
if
self
.
itimer
:
...
...
@@ -82,6 +84,8 @@ class WindowParent() = ManageOneChild():
self
.
win
.
setdocsize
(
self
.
size
)
bounds
=
(
0
,
0
),
self
.
win
.
getwinsize
()
self
.
child
.
setbounds
(
bounds
)
# Force a redraw of the entire window:
self
.
win
.
change
((
0
,
0
),
(
10000
,
10000
))
#
def
beginmeasuring
(
self
):
# Return something with which a child can measure text
...
...
@@ -137,7 +141,7 @@ class WindowParent() = ManageOneChild():
elif
type
=
WE_SIZE
:
self
.
fixup
()
elif
type
=
WE_CLOSE
:
self
.
delayed_destroy
()
self
.
close_trigger
()
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