diff options
author | Guido van Rossum <guido@python.org> | 1990-11-06 15:17:35 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1990-11-06 15:17:35 (GMT) |
commit | 124967ca8cf7f0ff37f20ba3c7587fc8001dac26 (patch) | |
tree | d6f92924555b969485bf4db99bdbdd074a2276d4 /Modules/stdwinmodule.c | |
parent | 2e4496710494391b12a8553f652494c035bae340 (diff) | |
download | cpython-124967ca8cf7f0ff37f20ba3c7587fc8001dac26.zip cpython-124967ca8cf7f0ff37f20ba3c7587fc8001dac26.tar.gz cpython-124967ca8cf7f0ff37f20ba3c7587fc8001dac26.tar.bz2 |
Turn close commands into WE_CLOSE events.
Remove (broken) compatibility hacks from cutbuffer interface.
Diffstat (limited to 'Modules/stdwinmodule.c')
-rw-r--r-- | Modules/stdwinmodule.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/Modules/stdwinmodule.c b/Modules/stdwinmodule.c index 68162ce..cae07cf 100644 --- a/Modules/stdwinmodule.c +++ b/Modules/stdwinmodule.c @@ -1314,6 +1314,10 @@ stdwin_getevent(sw, args) } if (e.window == NULL && (e.type == WE_COMMAND || e.type == WE_CHAR)) 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); if (v == NULL) return NULL; @@ -1511,15 +1515,8 @@ stdwin_setcutbuffer(self, args) { int i; object *str; - /* Compatibility hack: setcutbuffer(str) === setcutbuffer(0, str) */ - if (args != NULL && !is_tupleobject(args)) { - if (!getstrarg(args, &str)) - return NULL; - } - else { - if (!getintstrarg(args, &i, &str)) - return NULL; - } + if (!getintstrarg(args, &i, &str)) + return NULL; wsetcutbuffer(i, getstringvalue(str), getstringsize(str)); INCREF(None); return None; @@ -1533,10 +1530,7 @@ stdwin_getcutbuffer(self, args) int i; char *str; int len; - /* Compatibility hack: getcutbuffer() === getcutbuffer(0) */ - if (args == NULL) - i = 0; - else if (!getintarg(args, &i)) + if (!getintarg(args, &i)) return NULL; str = wgetcutbuffer(i, &len); if (str == NULL) { |