aboutsummaryrefslogtreecommitdiff
path: root/generic/tkZinc.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkZinc.c')
-rw-r--r--generic/tkZinc.c28
1 files changed, 22 insertions, 6 deletions
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
}