summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1990-10-30 13:39:00 (GMT)
committerGuido van Rossum <guido@python.org>1990-10-30 13:39:00 (GMT)
commit01769f083f8f0b9beb760a451e47edc37a4b5717 (patch)
treeec076e445033f959b856db918259bf8d152f0b0e /Modules
parent7f77e2d4f8cbb4de8405dd1d2d8c9272b1c9350a (diff)
downloadcpython-01769f083f8f0b9beb760a451e47edc37a4b5717.zip
cpython-01769f083f8f0b9beb760a451e47edc37a4b5717.tar.gz
cpython-01769f083f8f0b9beb760a451e47edc37a4b5717.tar.bz2
Change set/getcutbuffer to use the new stdwin interface.
This makes it possible to cut/paste strings wuth embedded null bytes.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/stdwinmodule.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/Modules/stdwinmodule.c b/Modules/stdwinmodule.c
index 3f472bb..f45211f 100644
--- a/Modules/stdwinmodule.c
+++ b/Modules/stdwinmodule.c
@@ -33,6 +33,7 @@
stdwin.getcutbuffer() and stdwin.setcutbuffer(); 'clip' is really
a bad word for what these functions do (clipping has a different
meaning in the drawing world), while cutbuffer is standard X jargon.
+ XXX This must change again in the light of changes to stdwin!
- For textedit, similar rules hold, but they are less strict.
XXX more?
*/
@@ -1472,7 +1473,7 @@ stdwin_setcutbuffer(self, args)
object *str;
if (!getstrarg(args, &str))
return NULL;
- wsetclip(getstringvalue(str), getstringsize(str));
+ wsetcutbuffer(0, getstringvalue(str), getstringsize(str));
INCREF(None);
return None;
}
@@ -1483,12 +1484,15 @@ stdwin_getcutbuffer(self, args)
object *args;
{
char *str;
+ int len;
if (!getnoarg(args))
return NULL;
- str = wgetclip();
- if (str == NULL)
+ str = wgetcutbuffer(0, &len);
+ if (str == NULL) {
str = "";
- return newstringobject(str);
+ len = 0;
+ }
+ return newsizedstringobject(str, len);
}
static struct methodlist stdwin_methods[] = {