Hi, From: "Markus Liebelt" <markus.liebelt / online.de> Subject: Using additional widget in Ruby Date: Sat, 8 Jan 2005 01:51:28 +0900 Message-ID: <opsj8rmbhf444ivd / lpmliebeltt40.kcf.sl-si.com> > Is it possible to install an additional widget written in Tcl/Tk and using > that widget in ruby without the change of any libraries? Yes, of course. Please see tktree.rb and tktree.tcl included in the Ruby source archive. You can find them ext/tk/sample directory. Probably, they exist at the samples folder of the one-click-ruby-installer. tktree.tcl is a widget written in pure Tcl/Tk. tktree.rb is a wrapper of the tktree widget. > The task I want to do is to install Bryan Douglas Oakley combobox and > using it in Ruby. If your Tcl/Tk can load the library, you can use it on your Ruby/Tk. However, you may have to add the library path to Tk::AUTO_PATH or Tk::PACKAGE_PATH or Tk::LIBRARY_PATH. To create and control the widget class, please use Tk.tk_call. Ruby/Tk can call all functions of Tcl/Tk, and can load Tcl/Tk scripts. Even if Tcl/Tk's functions aren't wrapped by Ruby's classes or methods, they can be called by Tk.tk_call (or TkCore::INTERP._invoke). Tk.tk_call does NOT use Tcl/Tk's command line parser for the reason of parsing overhead. It uses Tcl_GetCommandInfo() function to search Tcl/Tk's commands. Therefore, in rare cases, Ruby/Tk fails to autoload Tcl/Tk libraries. When you have such troubles, please use Tk.ip_eval method to call the Tcl/Tk command. The methods passes the argument string to Tcl/Tk's command line parser. -- Hidetoshi NAGAI (nagai / ai.kyutech.ac.jp)