Forum: Ruby-Gnome 2 How can my instantiated "worker" class talk to the UI?

Posted by Steve Gibson (Guest)
on 2010-02-09 22:52
(Received via mailing list)
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
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.