Using tktable under ruby

Hello,

I am building a db-handling app in ruby, with Tk GUI. I have found the
tktable widget for tk (http://tktable.sourceforge.net/), which is a
featureful table component with scrolling/editing/command
callback/caching, and looks good for displaying query results. It has
the capability of using a callback command to query the value of a cell,
and it passes values (row/col of the cell) to the callback function in
the same manner as bind (%c, %r …).

How should I define the command parameter of tktable in ruby to get use
of it? I need something like “… -command [list fnname %r %c] …”, and
of course the callback is written in ruby. Unfortunately, it seems that
the functions needed for to not to write from scratch are private in
TkComm/TkCore, e.g. ruby2tcl, and maybe install_cmd. Or am I missing
something?

Another question: are there other solution for displaying a database
query result in a grid using ruby/tk?

Thank you:
Circum

Hi,

···

From: Ferenc Engard ferenc@engard.hu
Subject: using tktable under ruby
Date: Fri, 5 Sep 2003 08:08:09 +0900
Message-ID: 3F57C4FA.DA14AAAC@engard.hu

How should I define the command parameter of tktable in ruby to get use
of it? I need something like “… -command [list fnname %r %c] …”, and
of course the callback is written in ruby. Unfortunately, it seems that
the functions needed for to not to write from scratch are private in
TkComm/TkCore, e.g. ruby2tcl, and maybe install_cmd. Or am I missing
something?

Unfortunately, current Ruby/Tk doesn’t have a general framework for
callbacks with parameters. But one of the sample is included in the
definition of TkEntry on Ruby 1.8.0. Please refer the implement of
‘validatecommand’ option of the entry widget.

                              Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)

How should I define the command parameter of tktable in ruby to get use
of it? I need something like “… -command [list fnname %r %c] …”, and
of course the callback is written in ruby. Unfortunately, it seems that
the functions needed for to not to write from scratch are private in
TkComm/TkCore, e.g. ruby2tcl, and maybe install_cmd. Or am I missing
something?

Unfortunately, current Ruby/Tk doesn’t have a general framework for
callbacks with parameters. But one of the sample is included in the
definition of TkEntry on Ruby 1.8.0. Please refer the implement of
‘validatecommand’ option of the entry widget.

Great, I wanted to write something similar (using install_cmd), and now
it revealed that I do not understand the ruby access control
(install_cmd is a private method). But now I have gone after it, and
everything is clear. :slight_smile:

Thanks for the help!

Circum