From 5961692b6a2986c9d8a33b721aca586c6e24fd04 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Mon, 20 Jan 2003 09:51:29 +0000 Subject: * (WidgetObjCmd): Corrige une erreur Tk lorsque l'on essayait de retrouver les callbacks associ�s � un binding vide sur 1 item. Maintenant on retourne correctment la chaine vide. --- generic/tkZinc.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'generic/tkZinc.c') diff --git a/generic/tkZinc.c b/generic/tkZinc.c index 0a1d027..696cb28 100644 --- a/generic/tkZinc.c +++ b/generic/tkZinc.c @@ -2505,7 +2505,7 @@ ZnParseCoordList(WidgetInfo *wi, /* * If first element is not a sublist, consider the whole list * as a flat array of coordinates in the old style. It can still - * be + * be a single point with or without a control flag. * If not, the list consists in sublists describing each point * with its control flag. */ @@ -3417,16 +3417,32 @@ WidgetObjCmd(ClientData client_data, /* Information about the widget. */ else if (argc == 4) { #ifdef PTK Tcl_Obj *command; + command = Tk_GetBinding(interp, wi->binding_table, elem, + Tcl_GetString(args[3])); + if (command == NULL) { + char *string = Tcl_GetString(Tcl_GetObjResult(interp)); + /* + * Ignore missing binding errors. This is a special hack + * that relies on the error message returned by FindSequence + * in tkBind.c. + */ + if (string[0] != '\0') { + goto error; + } + else { + Tcl_ResetResult(interp); + } + } + else { + Tcl_SetObjResult(interp, command); + } #else CONST char *command; -#endif - command = Tk_GetBinding(interp, wi->binding_table, elem, Tcl_GetString(args[3])); + command = Tk_GetBinding(interp, wi->binding_table, elem, + Tcl_GetString(args[3])); if (command == NULL) { goto error; } -#ifdef PTK - Tcl_SetObjResult(interp, command); -#else Tcl_SetObjResult(interp, NewStringObj(command)); #endif } -- cgit v1.1