]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Actualized
authorGuido van Rossum <guido@python.org>
Mon, 14 Dec 1992 16:40:24 +0000 (16:40 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 14 Dec 1992 16:40:24 +0000 (16:40 +0000)
Demo/sgi/gl/glstdwin/glstdwdraw.py
Demo/sgi/gl/glstdwin/glstdwmenu.py
Demo/sgi/gl/glstdwin/glstdwwin.py
Demo/sgi/gl/glstdwin/tglsw.py
Demo/sgi/gl/glstdwin/tmenu.py

index 009206506cd34abfe1357ade81d9a277c71801b5..4ddc7a67cb73995a680e2790810ee30657c4c04a 100644 (file)
@@ -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])
index 64eb333822f2930cf035ba51234ac80ce255c98d..dd6d90b6ea22ebd0ff64ca7a4a0118a65e216581 100644 (file)
@@ -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):
index e0245454dbd6575d8eb7fc75875d16c2ed343342..b880b9a1f9a494f2902410fe649230a3625b854c 100644 (file)
@@ -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)
index c066c4d05bdc95a3f1009349070322f976dad6f1..8854e9881261decbac1c2bcee16e0b7c3ec24471 100644 (file)
@@ -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:
index 97c6bc6374878b6eab92fd88159582ab15f5178a..233edae3c1640cfa2f9fba821c2c53b48ca871b5 100644 (file)
@@ -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