[Tcl Java] RE: [Tcl Java] RE: [Tcl Java] Re: [Tcl Java] more 1.2.4 questions

1999-10-28 Thread Moses DeJong
On Thu, 28 Oct 1999, Thomas McKay wrote: > How would I do it in Java? This is what I have now... ACK, NO! Do not call this.getClass() to get the second argument to the ReflectObject.newInstance() method. You need to use the actual Java Class object that the instance will be reflected as. For in

[Tcl Java] RE: [Tcl Java] RE: [Tcl Java] Re: [Tcl Java] more 1.2.4 questions

1999-10-28 Thread Thomas McKay
How would I do it in Java? This is what I have now... tclObject = ReflectObject.newInstance( interp, this.getClass(), this ); tclObject.preserve(); Would it be as simple as interp.renameCommand( tclObject.toString(), "rect20" ); Wou

[Tcl Java] RE: [Tcl Java] Re: [Tcl Java] more 1.2.4 questions

1999-10-28 Thread Moses DeJong
On Thu, 28 Oct 1999, Thomas McKay wrote: Here is a quick code example: % set o [java::new Object] java0x1 % $o toString java.lang.Object@80d05fd % rename $o rect20 % rect20 toString java.lang.Object@80d05fd The catch is that you need to delete this renamed object like so. % rename rect20 {} % u

[Tcl Java] RE: [Tcl Java] Re: [Tcl Java] more 1.2.4 questions

1999-10-28 Thread Thomas McKay
Well, I was hoping to be able to supply a prefix to use in place of the "java0x". My average user would understand it more if they saw "rect20" or "polygon34". I'll poke around a bit and see how hard this would be to add. I'll try out the namespace commands. I'm not an experienced traditional-