Turn close commands into WE_CLOSE events.

Remove (broken) compatibility hacks from cutbuffer interface.
This commit is contained in:
Guido van Rossum 1990-11-06 15:17:35 +00:00
parent 2e44967104
commit 124967ca8c
1 changed files with 7 additions and 13 deletions

View File

@ -1314,6 +1314,10 @@ stdwin_getevent(sw, args)
} }
if (e.window == NULL && (e.type == WE_COMMAND || e.type == WE_CHAR)) if (e.window == NULL && (e.type == WE_COMMAND || e.type == WE_CHAR))
goto again; goto again;
if (e.type == WE_COMMAND && e.u.command == WC_CLOSE) {
/* Turn WC_CLOSE commands into WE_CLOSE events */
e.type = WE_CLOSE;
}
v = newtupleobject(3); v = newtupleobject(3);
if (v == NULL) if (v == NULL)
return NULL; return NULL;
@ -1511,15 +1515,8 @@ stdwin_setcutbuffer(self, args)
{ {
int i; int i;
object *str; object *str;
/* Compatibility hack: setcutbuffer(str) === setcutbuffer(0, str) */ if (!getintstrarg(args, &i, &str))
if (args != NULL && !is_tupleobject(args)) { return NULL;
if (!getstrarg(args, &str))
return NULL;
}
else {
if (!getintstrarg(args, &i, &str))
return NULL;
}
wsetcutbuffer(i, getstringvalue(str), getstringsize(str)); wsetcutbuffer(i, getstringvalue(str), getstringsize(str));
INCREF(None); INCREF(None);
return None; return None;
@ -1533,10 +1530,7 @@ stdwin_getcutbuffer(self, args)
int i; int i;
char *str; char *str;
int len; int len;
/* Compatibility hack: getcutbuffer() === getcutbuffer(0) */ if (!getintarg(args, &i))
if (args == NULL)
i = 0;
else if (!getintarg(args, &i))
return NULL; return NULL;
str = wgetcutbuffer(i, &len); str = wgetcutbuffer(i, &len);
if (str == NULL) { if (str == NULL) {