summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Demo/sgi/gl/glstdwin/glstdwdraw.py14
-rw-r--r--Demo/sgi/gl/glstdwin/glstdwmenu.py18
-rw-r--r--Demo/sgi/gl/glstdwin/glstdwwin.py2
-rw-r--r--Demo/sgi/gl/glstdwin/tglsw.py6
-rw-r--r--Demo/sgi/gl/glstdwin/tmenu.py2
5 files changed, 22 insertions, 20 deletions
diff --git a/Demo/sgi/gl/glstdwin/glstdwdraw.py b/Demo/sgi/gl/glstdwin/glstdwdraw.py
index 0092065..4ddc7a6 100644
--- a/Demo/sgi/gl/glstdwin/glstdwdraw.py
+++ b/Demo/sgi/gl/glstdwin/glstdwdraw.py
@@ -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])
diff --git a/Demo/sgi/gl/glstdwin/glstdwmenu.py b/Demo/sgi/gl/glstdwin/glstdwmenu.py
index 64eb333..dd6d90b 100644
--- a/Demo/sgi/gl/glstdwin/glstdwmenu.py
+++ b/Demo/sgi/gl/glstdwin/glstdwmenu.py
@@ -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):
diff --git a/Demo/sgi/gl/glstdwin/glstdwwin.py b/Demo/sgi/gl/glstdwin/glstdwwin.py
index e024545..b880b9a 100644
--- a/Demo/sgi/gl/glstdwin/glstdwwin.py
+++ b/Demo/sgi/gl/glstdwin/glstdwwin.py
@@ -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)
diff --git a/Demo/sgi/gl/glstdwin/tglsw.py b/Demo/sgi/gl/glstdwin/tglsw.py
index c066c4d..8854e98 100644
--- a/Demo/sgi/gl/glstdwin/tglsw.py
+++ b/Demo/sgi/gl/glstdwin/tglsw.py
@@ -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:
diff --git a/Demo/sgi/gl/glstdwin/tmenu.py b/Demo/sgi/gl/glstdwin/tmenu.py
index 97c6bc6..233edae 100644
--- a/Demo/sgi/gl/glstdwin/tmenu.py
+++ b/Demo/sgi/gl/glstdwin/tmenu.py
@@ -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