using tktable under ruby

F

Ferenc Engard

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
 
H

Hidetoshi NAGAI

Hi,

From: Ferenc Engard <[email protected]>
Subject: using tktable under ruby
Date: Fri, 5 Sep 2003 08:08:09 +0900
Message-ID: said:
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.
 
F

Ferenc Engard

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. :)

Thanks for the help!

Circum
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,121
Messages
2,570,712
Members
47,282
Latest member
hopkins1988

Latest Threads

Top