On 6/7/17 10:44 PM, Kevin Walzer wrote:
> I am having difficulty calling various Tk extension packages from 
> Ruby-Tk. As an example, I have a package called "windowlist," which is 
> correctly loaded with this call:
>
> TkPackage.require('windowlist')
>
> Later, when I call a Tk command from this library, I get a runtime 
> error, "invalid command name." Here is the call:
>
>  Tk.tk_call("windowlist::windowMenu",  $menubar)
>
> The package has been successfully loaded via the "package require" 
> bits above, so it is not clear to me why this command fails. Similar 
> calls in Python and Perl work just fine. Does Ruby-Tk require some 
> kind of wrapper function to call namespaced Tcl commands?
>
> I am using Tk 8.6.6 and ruby 2.3.1p112.
>
> --Kevin
>
Turns out it was a scoping issue...once I moved the TkPackage.require 
call to the toplevel scope, things worked fine.

--Kevin

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


Unsubscribe: <mailto:ruby-talk-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>