]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Added a clear() method to VFile class, to be called when the window
authorGuido van Rossum <guido@python.org>
Tue, 1 Sep 1992 14:45:57 +0000 (14:45 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 1 Sep 1992 14:45:57 +0000 (14:45 +0000)
receives a REDRAW event

Demo/sgi/video/VFile.py
Demo/sgi/video/Vedit.py
Demo/sgi/video/Vinfo.py
Demo/sgi/video/Vplay.py
Demo/sgi/video/Vrec.py

index b16b2ab78033632ffcac9e67dcf6cf0bb2fcd78f..e43bd9446d15fe99855a4c1646dd28160a3c2f68 100755 (executable)
@@ -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)
index 9cae9317a561936b2b2b65608560c18dac45dc86..6993dfa026e8c6297f62655aa8bc8d7a778fd85f 100755 (executable)
@@ -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]'
index 457aebc11ed7d1083d0ba9bbb00ffd3a614b7e9d..341ddbf1c16160b96d263c227fe1110431be2fbd 100755 (executable)
@@ -120,4 +120,7 @@ def process(filename):
 
 # Don't forget to call the main program
 
-main()
+try:
+       main()
+except KeyboardInterrupt:
+       print '[Interrupt]'
index b8d06a1ff399a0212306826894c10f17dfc26741..5f02ef1349b361d4afe154a528548045f448cd52 100755 (executable)
@@ -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, \
index e246f5424af29563164526b8706c87d22db63a4d..a3ebdd81bd49295c786f9890137d2c1b6bcb384d 100755 (executable)
@@ -260,4 +260,7 @@ def audiorecord(afile, aport, buffer):
 
 # Don't forget to call the main program
 
-main()
+try:
+       main()
+except KeyboardInterrupt:
+       print '[Interrupt]'