I was trying to compile the example in the Dr. Dobbs article about TclBlend:

import java.awt.event.*;

public class TestActionListener implements ActionListener {
    public TestActionListener(tcl.lang.Interp i, String s) {
        interp = i;
        script = s;
    }

    public void actionPerformed(ActionEvent e) {
        try {
            interp.setVar("event",
                    tcl.lang.ReflectObject.newInstance(interp, e), 0);
            interp.eval(script);
        } catch (tcl.lang.TclException te) {
            System.out.println("error in ActionListener script: "
                                 + interp.getResult());
        }
    }

    private tcl.lang.Interp interp;
    private String script;
}

( http://www.ddj.com/articles/1998/9802/9802d/9802d.htm#l5 )

I get the following compiler error:

TestActionListener.java:12: Wrong number of arguments in method.
                    tcl.lang.ReflectObject.newInstance(interp, e), 0);
                                                      ^
1 error

Using java::info in Tcl I determined that the signature of newInstance is:

{tcl.lang.TclObject {newInstance tcl.lang.Interp java.lang.Class
java.lang.Object} tcl.lang.TclException}

So what should the class argument be?

--------------------------------------------------------------------------
Hugh Dunne, CIENA Core Switching Division
10201 Bubb Rd., Cupertino, CA 95014
[EMAIL PROTECTED]       +1-408-865-6485

----------------------------------------------------------------
The TclJava mailing list is sponsored by WebNet Technologies.
To subscribe:    send mail to [EMAIL PROTECTED]  
                 with the word SUBSCRIBE as the subject.
To unsubscribe:  send mail to [EMAIL PROTECTED] 
                 with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'. 
A list archive is at: http://www.findmail.com/listsaver/tcldallas/

Reply via email to