Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e0be2b3

Browse files
committed
Added a clear() method to VFile class, to be called when the window
receives a REDRAW event
1 parent 61700bb commit e0be2b3

5 files changed

Lines changed: 19 additions & 7 deletions

File tree

Demo/sgi/video/VFile.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,18 @@ def initcolormap(self):
122122
if not self.quiet:
123123
sys.stderr.write('Initializing color map...')
124124
self.initcmap()
125+
self.clear()
125126
if not self.quiet:
126127
sys.stderr.write(' Done.\n')
128+
129+
def clear(self):
127130
if self.offset == 0:
128131
gl.color(0x800)
129132
gl.clear()
130133
self.mask = 0x7ff
131134
else:
132135
self.mask = 0xfff
133-
gl.clear()
134-
136+
gl.clear()
135137

136138
def initcmap(self):
137139
maxbits = gl.getgdesc(GL.GD_BITS_NORM_SNG_CMODE)

Demo/sgi/video/Vedit.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,4 +246,8 @@ def format(self, io):
246246
getattr(self, io + '_info2').label = `pos`
247247
getattr(self, io + '_info3').label = `right`
248248

249-
main()
249+
250+
try:
251+
main()
252+
except KeyboardInterrupt:
253+
print '[Interrupt]'

Demo/sgi/video/Vinfo.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,7 @@ def process(filename):
120120

121121
# Don't forget to call the main program
122122

123-
main()
123+
try:
124+
main()
125+
except KeyboardInterrupt:
126+
print '[Interrupt]'

Demo/sgi/video/Vplay.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def main():
7373
# Interpret options
7474
try:
7575
for opt, arg in opts:
76-
if opt == '-M': magnify = string.atoi(arg)
76+
if opt == '-M': magnify = float(eval(arg))
7777
if opt == '-d': debug = debug + 1
7878
if opt == '-l': looping = 1
7979
if opt == '-m': mindelta = string.atoi(arg)
@@ -147,7 +147,7 @@ def process(filename):
147147

148148
gl.foreground()
149149

150-
width, height = vin.width * magnify, vin.height * magnify
150+
width, height = int(vin.width * magnify), int(vin.height * magnify)
151151
if xoff <> None and yoff <> None:
152152
scrheight = gl.getgdesc(GL.GD_YPMAX)
153153
gl.prefposition(xoff, xoff+width-1, \

Demo/sgi/video/Vrec.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,4 +260,7 @@ def audiorecord(afile, aport, buffer):
260260

261261
# Don't forget to call the main program
262262

263-
main()
263+
try:
264+
main()
265+
except KeyboardInterrupt:
266+
print '[Interrupt]'

0 commit comments

Comments
 (0)