How can my instantiated "worker" class talk to the UI?

So I have a simple app that is a console IRC client. It uses sockets to
connect to the specified server, interprets commands entered by the user
(via STDIN), and writes data received from the socket to STDOUT.
Simple.

Now I want to use this class (after whatever mods are needed) with a
ruby-gtk GUI. I’ve used Glade3 to layout the basic UI and used
ruby-glade-create-template to generate some initial code. I am able to
use
the on_connect_clicked method to create a new IRC object which
succesfully
connects and I can see the output to the console… but now what? I’m
at a
loss for how one goes about having the output go to a Gtk TextBuffer
rather
than “putsing” it to STDOUT. I think I could use globals and get it to
work, but I’m not sure… and I think that may be a bad idea.

Any advice or pointers would be appreciated.

Thanks,
-Steve

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs