IRB on a text widget of Ruby/Tk

  • Thread starter Hidetoshi NAGAI
  • Start date
H

Hidetoshi NAGAI

Hi,

A sample tool of Ruby/Tk is available.
It uses a text widget as a console I/O.
If you have troubles about thread-switching on IRB
(for example, IRB on a command-prompt of Windows),
it may be able to help you.

Console I/O on Windows blocks Ruby's thread-switching.
That is, IRB cannot work with background threads on Windows.
On the sample script, a text widget takes the place of a console
without blocking thread-switching.
That is similar to Tcl/Tk's "wish" unless not calling shell commands.

If you may try it, please get two files from Ruby's CVS tree.
Those are "ext/tk/sample/irbtkw.rbw" and "ext/tk/sample/tktextio.rb".
"irbtkw.rbw" is the main script.

"tktextio.rb" is updated (it is a by-product of Ruby/TkORCA).
Old one cannot work with "irbtkw.rbw".

Probably, "irbtkw.rbw" will work on ruby-1.8.2 or later.
 

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
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top