summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1991-05-28 21:57:04 (GMT)
committerGuido van Rossum <guido@python.org>1991-05-28 21:57:04 (GMT)
commit4b9cf8eed98f6a2f35531921e92df8cc07d703d4 (patch)
tree0d8f79ebf394f24e5b0de495ef1a279f609c247c /Modules
parenta759f64294ad25e02428bd38e6af7bab8e98f54d (diff)
downloadcpython-4b9cf8eed98f6a2f35531921e92df8cc07d703d4.zip
cpython-4b9cf8eed98f6a2f35531921e92df8cc07d703d4.tar.gz
cpython-4b9cf8eed98f6a2f35531921e92df8cc07d703d4.tar.bz2
Added text.setactive and text.setview.
Moved some functions around.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/stdwinmodule.c42
1 files changed, 37 insertions, 5 deletions
diff --git a/Modules/stdwinmodule.c b/Modules/stdwinmodule.c
index 07bb866..32f5f22 100644
--- a/Modules/stdwinmodule.c
+++ b/Modules/stdwinmodule.c
@@ -942,6 +942,32 @@ text_move(self, args)
}
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;
object *args;
@@ -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 */
};