Andres Salomon: Dabber
I’ve begun writing a jabber client, initially using xmpp4r, but after realizing that it’s missing features, I think I’m going to write ruby bindings for some other (C or C++) based library that has more features (any suggestions for which one?).
I’m working on the interface using Glade 2. Overall, I’m quite impressed with it. I’ve discovered that it makes more sense to have a separate project per window (versus keeping all windows in memory, even when they’re never used). What this ends up looking like is this:
include LoginWin
def login_window(conn)
if @loginwin.nil?
l = GladeXML.new('../dabber_loginwin.glade') h method(h)
@loginwin = l['loginwin']
end
conn
end
include ChatWin
def chat_window(conn)
if @chatwin.nil?
c = GladeXML.new('../dabber_chatwin.glade') h method(h)
@chatwin = c['chatwin']
end
if conn.nil?
login_window(conn)
end
conn
end
The last gtk project I worked on was Sinek. Working with gtk in Ruby instead of C, combined w/ tab completion (
require 'irb/completion' ARGV.concat(['--readline', '--prompt-mode', 'simple'])in your .irbrc) means I don’t have to waste time poring through the gtk manual looking up what methods a given object actually supports; I just create the object, hit tab a few times, and see a nice concise list. *Much* nicer to deal w/!