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
d668782a
Commit
d668782a
authored
Dec 14, 1992
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Actualized
parent
3361e3a6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
20 deletions
+22
-20
Demo/sgi/gl/glstdwin/glstdwdraw.py
Demo/sgi/gl/glstdwin/glstdwdraw.py
+7
-7
Demo/sgi/gl/glstdwin/glstdwmenu.py
Demo/sgi/gl/glstdwin/glstdwmenu.py
+10
-8
Demo/sgi/gl/glstdwin/glstdwwin.py
Demo/sgi/gl/glstdwin/glstdwwin.py
+1
-1
Demo/sgi/gl/glstdwin/tglsw.py
Demo/sgi/gl/glstdwin/tglsw.py
+3
-3
Demo/sgi/gl/glstdwin/tmenu.py
Demo/sgi/gl/glstdwin/tmenu.py
+1
-1
No files found.
Demo/sgi/gl/glstdwin/glstdwdraw.py
View file @
d668782a
...
...
@@ -48,10 +48,10 @@ class DrawingObject:
#print 'box', ((left, top), (right, bottom))
gl
.
rect
(
left
,
top
,
right
,
bottom
)
#
def
circle
(
self
,
(
(
h
,
v
),
radius
)
):
def
circle
(
self
,
(
h
,
v
),
radius
):
gl
.
circ
(
h
,
v
,
radius
)
#
def
elarc
(
self
,
(
center
,
(
rh
,
rv
),
a1
,
a2
)):
def
elarc
(
self
,
center
,
(
rh
,
rv
),
(
a1
,
a2
)):
pass
# XXX
#
def
erase
(
self
,
((
left
,
top
),
(
right
,
bottom
))):
...
...
@@ -68,14 +68,14 @@ class DrawingObject:
gl
.
color
(
self
.
fg
)
gl
.
logicop
(
LO_SRC
)
#
def
line
(
self
,
(
(
h0
,
v0
),
(
h1
,
v1
)
)):
def
line
(
self
,
(
h0
,
v0
),
(
h1
,
v1
)):
#print 'line', ((h0, v0), (h1, v1))
gl
.
bgnline
()
gl
.
v2i
(
h0
,
v0
)
gl
.
v2i
(
h1
,
v1
)
gl
.
endline
()
#
def
xorline
(
self
,
(
(
h0
,
v0
),
(
h1
,
v1
)
)):
def
xorline
(
self
,
(
h0
,
v0
),
(
h1
,
v1
)):
#print 'xorline', ((h0, v0), (h1, v1))
gl
.
logicop
(
LO_XOR
)
gl
.
color
(
self
.
bg
)
...
...
@@ -92,7 +92,7 @@ class DrawingObject:
gl
.
v2i
(
h
,
v
)
gl
.
endpoint
()
#
def
text
(
self
,
(
(
h
,
v
),
string
)
):
def
text
(
self
,
(
h
,
v
),
string
):
#print 'text', ((h, v), string)
if
h
<
0
:
# If the point is outside the window
...
...
@@ -108,7 +108,7 @@ class DrawingObject:
self
.
font
.
setfont
()
fm
.
prstr
(
string
)
#
def
shade
(
self
,
(
(
h
,
v
),
percent
)
):
def
shade
(
self
,
(
h
,
v
),
percent
):
pass
# XXX
#
def
baseline
(
self
):
...
...
@@ -121,7 +121,7 @@ class DrawingObject:
height
,
nglyphs
)
=
self
.
font
.
getfontinfo
()
return
height
#
def
textbreak
(
self
,
(
string
,
width
)
):
def
textbreak
(
self
,
string
,
width
):
# XXX Slooooow!
n
=
len
(
string
)
nwidth
=
self
.
textwidth
(
string
[:
n
])
...
...
Demo/sgi/gl/glstdwin/glstdwmenu.py
View file @
d668782a
...
...
@@ -5,7 +5,7 @@ from glstdwin import key2code
class
MenuObject
:
#
def
_init
(
self
,
(
win
,
title
)
):
def
_init
(
self
,
win
,
title
):
self
.
_win
=
win
self
.
_title
=
title
self
.
_items
=
[]
...
...
@@ -15,20 +15,22 @@ class MenuObject:
self
.
_win
.
remove
(
self
)
del
self
.
_win
#
def
additem
(
self
,
arg
):
if
type
(
arg
)
==
type
(()):
text
,
shortcut
=
arg
def
additem
(
self
,
*
args
):
if
len
(
args
)
==
2
:
text
,
shortcut
=
args
elif
len
(
args
)
==
1
:
text
,
shortcut
=
args
[
0
],
None
else
:
text
,
shortcut
=
arg
,
None
raise
TypeError
,
'arg count'
self
.
_items
.
append
([
text
,
shortcut
,
1
,
0
])
#
def
setitem
(
self
,
(
i
,
text
)
):
def
setitem
(
self
,
i
,
text
):
self
.
_items
[
i
][
0
]
=
text
#
def
enable
(
self
,
(
i
,
flag
)
):
def
enable
(
self
,
i
,
flag
):
self
.
_items
[
i
][
2
]
=
flag
#
def
check
(
self
,
(
i
,
flag
)
):
def
check
(
self
,
i
,
flag
):
self
.
_items
[
i
][
3
]
=
flag
#
def
_makepup
(
self
,
firstitem
):
...
...
Demo/sgi/gl/glstdwin/glstdwwin.py
View file @
d668782a
...
...
@@ -51,7 +51,7 @@ class WindowObject:
def
getwinsize
(
self
):
return
self
.
_area
[
1
]
#
def
scroll
(
self
,
(
area
,
by
)
):
def
scroll
(
self
,
area
,
by
):
# XXX ought to use gl.rectcopy()
if
by
<>
(
0
,
0
):
self
.
change
(
area
)
...
...
Demo/sgi/gl/glstdwin/tglsw.py
View file @
d668782a
...
...
@@ -33,9 +33,9 @@ def main():
d
=
window
.
begindrawing
()
if
window
==
w1
:
if
color
:
d
.
setfgcolor
(
BLACK
)
d
.
box
((
50
,
50
),
(
250
,
250
))
d
.
box
((
(
50
,
50
),
(
250
,
250
)
))
if
color
:
d
.
setfgcolor
(
RED
)
d
.
cliprect
((
50
,
50
),
(
250
,
250
))
d
.
cliprect
((
(
50
,
50
),
(
250
,
250
)
))
d
.
paint
(
w1
.
box
)
d
.
noclip
()
if
color
:
d
.
setfgcolor
(
BLUE
)
...
...
@@ -59,7 +59,7 @@ def main():
elif
type
in
(
WE_MOUSE_DOWN
,
WE_MOUSE_MOVE
,
WE_MOUSE_UP
):
h
,
v
=
detail
[
0
]
window
.
box
=
(
h
,
v
),
(
h
+
80
,
v
+
80
)
window
.
change
((
0
,
0
),
(
2000
,
2000
))
window
.
change
((
(
0
,
0
),
(
2000
,
2000
)
))
elif
type
==
WE_CHAR
:
print
'character'
,
`detail`
else
:
...
...
Demo/sgi/gl/glstdwin/tmenu.py
View file @
d668782a
...
...
@@ -27,7 +27,7 @@ def main():
break
elif
type
==
WE_DRAW
:
d
=
w
.
begindrawing
()
d
.
box
((
50
,
50
),
(
100
,
100
))
d
.
box
((
(
50
,
50
),
(
100
,
100
)
))
del
d
elif
type
==
WE_MENU
:
mp
,
i
=
detail
...
...
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