Hello,
I needed to write a test/monitoring program for an application that is
written in C++ which sends and receives messages on sockets. Normally I
would write such a test application in most likely C++, java because I need
gui. I have been tying to learn ruby for some time, and it is very much easy
to write all other stuff except the gui part in ruby. I am trying to use tk
as well as gtk for learning purposes.
I am using ruby 1.8.15 (one click installation for windows) about the tk
library that comes with it. I have downloaded and installed
Ruby-GNOME2-0.14.1.for
windows.
<http://ruby-gnome2.sourceforge.jp/#Ruby-GNOME2-0.14.1+released.>
I have perl tk book, and trying to translate it to ruby and use the features
that are explained there. I have noticed that very crucial notebook widget
is not available. I have also noticed that some of the other features such
as binding external events and geometry managers except pack manager that
are available in perl tk are not available in ruby binding. Even such a
small application, this makes tk almost unusable as gui toolkit. Besides I
could not find a way to integrate an external event loop or process to Tk
eventloop. There are some explanations about filevent and tk send interface
which iseemed not available in windows and in ruby.
I find gtk much more convenient especially with the use of glade ide and
libglade ruby binding. Even if know almost nothing about gtk, by using glade
interface designer and libglade binding, I was able to create quite
sophisticated well looking window with necessary events handled without
writing a line of ruby code. On the other hand, I have not been able to
figure out how to integrate a socket server to Gtk event loop.
To make to long story short, I need help about integration of a socket
server process/thread to Gtk and Tk event loop. How can I hook a callback to
these event loops so that when a new data is available the callback is
called automatically.
I expect a high volume of network traffic so I need to decouple the gui
event loop and the server process.
Any help much appreciated and thanks in advance.
TaO