CreateCommand question

[email protected] (Kevin Walzer) Wed, 06 May 2015 10:59:56 -0400
Newsgroups perl.tcltk
Organization WordTech Communications LLC
Message-ID <[email protected]>
Hello,

I am working on a Perl/Tkx app and trying to use the Tcl module's 
CreateCommand call to feed a Perl subroutine directly to the Tcl 
interpreter. There is no documentation on how to do this directly from 
Tkx so I've done a bit of code diving into the module's internals.

This is what I've come up with, but it's not working well:

#get Tkx's interpreter instance rather than creating a new interpreter; 
this is undocumented but should work
my $interp = Tkx::i::interp;

#next, pass a Perl subroutine to the Tcl interpreter

$interp->CreateCommand("", \&scriptSetDir, "", "", "");
sub scriptSetDir {

     my $dname = shift;
     &selectFileSystem($dname);

}

This call produces no output:

Tkx::eval("scriptSetDir", "/Users/kevin");

Any suggestions as to what I am doing wrong?

Kevin

-- 
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com