]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Added text.setactive and text.setview.
authorGuido van Rossum <guido@python.org>
Tue, 28 May 1991 21:57:04 +0000 (21:57 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 28 May 1991 21:57:04 +0000 (21:57 +0000)
Moved some functions around.

Modules/stdwinmodule.c

index 07bb866b2f20b15efee75411131732d5149d13f6..32f5f2272d5c61e87bc16c0a84424d4c3d8d67d6 100644 (file)
@@ -941,6 +941,32 @@ text_move(self, args)
        return None;
 }
 
+static object *
+text_replace(self, args)
+       textobject *self;
+       object *args;
+{
+       object *text;
+       if (!getstrarg(args, &text))
+               return NULL;
+       tereplace(self->t_text, getstringvalue(text));
+       INCREF(None);
+       return None;
+}
+
+static object *
+text_setactive(self, args)
+       textobject *self;
+       object *args;
+{
+       int flag;
+       if (!getintarg(args, &flag))
+               return NULL;
+       tesetactive(self->t_text, flag);
+       INCREF(None);
+       return None;
+}
+
 static object *
 text_setfocus(self, args)
        textobject *self;
@@ -976,14 +1002,18 @@ text_settext(self, args)
 }
 
 static object *
-text_replace(self, args)
+text_setview(self, args)
        textobject *self;
        object *args;
 {
-       object *text;
-       if (!getstrarg(args, &text))
-               return NULL;
-       tereplace(self->t_text, getstringvalue(text));
+       int a[4];
+       if (args == None)
+               tenoview(self->t_text);
+       else {
+               if (!getrectarg(args, a))
+                       return NULL;
+               tesetview(self->t_text, a[0], a[1], a[2], a[3]);
+       }
        INCREF(None);
        return None;
 }
@@ -998,8 +1028,10 @@ static struct methodlist text_methods[] = {
        "gettext",      text_gettext,
        "move",         text_move,
        "replace",      text_replace,
+       "setactive",    text_setactive,
        "setfocus",     text_setfocus,
        "settext",      text_settext,
+       "setview",      text_setview,
        {NULL,          NULL}           /* sentinel */
 };