Modify gcbo in callback
Vincent Couvert [Tue, 8 Apr 2008 15:18:02 +0000 (15:18 +0000)]
scilab/modules/gui/src/java/org/scilab/modules/gui/events/callback/CallBack.java

index 17a1fbe..e17b6ef 100644 (file)
@@ -91,12 +91,10 @@ public abstract class CallBack extends AbstractAction {
                } else if (callbackType == CallBack.SCILAB_INSTRUCTION_WITHOUT_GCBO) {
                        return ScilabCallBack.create(command);
                } else {
-                       return ScilabCallBack.create("%oldgcbo = [];" 
-                                       + "if exists(\"gcbo\") then %oldgcbo = gcbo; end;"
+                       return ScilabCallBack.create("if exists(\"gcbo\") then %oldgcbo = gcbo; end;"
                                        + "gcbo = getcallbackobject(" + objectIndex + ");"
                                        + command 
-                                       + ";if exists(\"%oldgcbo\") then gcbo = %oldgcbo; end;"
-                                       + "clear gcbo;");
+                                       + ";if exists(\"%oldgcbo\") then gcbo = %oldgcbo; else clear gcbo; end;");
                }
        }