From: Hidetoshi NAGAI Date: 2012-09-04T15:55:14+09:00 Subject: Re: updating tk tablelist support? From: "Fred L." Subject: updating tk tablelist support? Date: Thu, 30 Aug 2012 17:24:36 +0900 Message-ID: > in tkextlib\tcllib there is the "tablelist" package that I found > interesting and will try to use in my next personal work/learning > program. > the ruby interface files seems to be for an older version than what is > available here : http://www.nemethi.de/ I think that there is no relation between it and tcllib(tklib) version of 'tablelist'. You have to control tcl interpreter directly (by Tk.tk_call method, and so on), or write your own wrapper library. For example, when you want to use a widget object which is created by '::tk::foowidget' tcl command and whose tcl classname is 'FooWidget', an example of minimum definition of a wrapper class is ----------------------------------------- class MyFooWidget < TkWindow TkCommandNames = ['tk::foowidget'.freeze].freeze WidgetClassName = 'FooWidget'.freeze WidgetClassNames[WidgetClassName] ||= self end ----------------------------------------- Then, you can use a MyFooWdiget widget object with Ruby/Tk's standard methods for widget objects (e.g. 'foo_widget = MyFooWidget.new(...){ ... }', 'foo_widget.pack(...)', 'foo_widget.foo_optkey = ...', and so on). Of course, the wrapper has no special methods for the widget class. So, when you want to use a a subcommand of the widget "bar opt ...", for example, you must call 'foo_widget.tk_send("bar", opt, ...)'. Please check library files under "/tkextlib". Those are examples of how to write wrapper libraries. -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) Department of Artificial Intelligence, Kyushu Institute of Technology