summaryrefslogtreecommitdiffstats
path: root/Demo/sgi
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-09-01 14:45:57 (GMT)
committerGuido van Rossum <guido@python.org>1992-09-01 14:45:57 (GMT)
commite0be2b36b61078258213d1ddc7318bb4887ede28 (patch)
tree4ffc4064d1d26fb598759404d9172e5588b56783 /Demo/sgi
parent61700bb985ce2708f489dae6397cf4be3e934d1a (diff)
downloadcpython-e0be2b36b61078258213d1ddc7318bb4887ede28.zip
cpython-e0be2b36b61078258213d1ddc7318bb4887ede28.tar.gz
cpython-e0be2b36b61078258213d1ddc7318bb4887ede28.tar.bz2
Added a clear() method to VFile class, to be called when the window
receives a REDRAW event
Diffstat (limited to 'Demo/sgi')
-rwxr-xr-xDemo/sgi/video/VFile.py6
-rwxr-xr-xDemo/sgi/video/Vedit.py6
-rwxr-xr-xDemo/sgi/video/Vinfo.py5
-rwxr-xr-xDemo/sgi/video/Vplay.py4
-rwxr-xr-xDemo/sgi/video/Vrec.py5
5 files changed, 19 insertions, 7 deletions
diff --git a/Demo/sgi/video/VFile.py b/Demo/sgi/video/VFile.py
index b16b2ab..e43bd94 100755
--- a/Demo/sgi/video/VFile.py
+++ b/Demo/sgi/video/VFile.py
@@ -122,16 +122,18 @@ class VFile:
if not self.quiet:
sys.stderr.write('Initializing color map...')
self.initcmap()
+ self.clear()
if not self.quiet:
sys.stderr.write(' Done.\n')
+
+ def clear(self):
if self.offset == 0:
gl.color(0x800)
gl.clear()
self.mask = 0x7ff
else:
self.mask = 0xfff
- gl.clear()
-
+ gl.clear()
def initcmap(self):
maxbits = gl.getgdesc(GL.GD_BITS_NORM_SNG_CMODE)
diff --git a/Demo/sgi/video/Vedit.py b/Demo/sgi/video/Vedit.py
index 9cae931..6993dfa 100755
--- a/Demo/sgi/video/Vedit.py
+++ b/Demo/sgi/video/Vedit.py
@@ -246,4 +246,8 @@ class Editor:
getattr(self, io + '_info2').label = `pos`
getattr(self, io + '_info3').label = `right`
-main()
+
+try:
+ main()
+except KeyboardInterrupt:
+ print '[Interrupt]'
diff --git a/Demo/sgi/video/Vinfo.py b/Demo/sgi/video/Vinfo.py
index 457aebc..341ddbf 100755
--- a/Demo/sgi/video/Vinfo.py
+++ b/Demo/sgi/video/Vinfo.py
@@ -120,4 +120,7 @@ def process(filename):
# Don't forget to call the main program
-main()
+try:
+ main()
+except KeyboardInterrupt:
+ print '[Interrupt]'
diff --git a/Demo/sgi/video/Vplay.py b/Demo/sgi/video/Vplay.py
index b8d06a1..5f02ef1 100755
--- a/Demo/sgi/video/Vplay.py
+++ b/Demo/sgi/video/Vplay.py
@@ -73,7 +73,7 @@ def main():
# Interpret options
try:
for opt, arg in opts:
- if opt == '-M': magnify = string.atoi(arg)
+ if opt == '-M': magnify = float(eval(arg))
if opt == '-d': debug = debug + 1
if opt == '-l': looping = 1
if opt == '-m': mindelta = string.atoi(arg)
@@ -147,7 +147,7 @@ def process(filename):
gl.foreground()
- width, height = vin.width * magnify, vin.height * magnify
+ width, height = int(vin.width * magnify), int(vin.height * magnify)
if xoff <> None and yoff <> None:
scrheight = gl.getgdesc(GL.GD_YPMAX)
gl.prefposition(xoff, xoff+width-1, \
diff --git a/Demo/sgi/video/Vrec.py b/Demo/sgi/video/Vrec.py
index e246f54..a3ebdd8 100755
--- a/Demo/sgi/video/Vrec.py
+++ b/Demo/sgi/video/Vrec.py
@@ -260,4 +260,7 @@ def audiorecord(afile, aport, buffer):
# Don't forget to call the main program
-main()
+try:
+ main()
+except KeyboardInterrupt:
+ print '[Interrupt]'