Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
38 lines (28 sloc) 1.04 KB

Write a 17-line fake chat client using Shoes

At first I have to say my apologies in advance. This is a FAKE chat client. It's useless so far. Just for fun. ;-)

This is a great blog. I was inspired. Thanks to Paul Harris. He tweeted me.
Write a 32-line chat client using Ruby, AMQP & EventMachine (and a GUI using Shoes)

# sample70.rb
%w[ashbb Paul Max].each do |name|
  blk = lambda do
    self.clipboard = ''
    ed = edit_line
    button('ok'){self.clipboard = "#{name}: #{ed.text}"}
    slot = stack
    msg = ''
    every 1 do
      slot.append do
        tmp = clipboard
        para tmp unless msg == tmp
        msg = tmp
      end
    end
  end

  Shoes.app :title => name, :width => 300, :height => 500, &blk
end

sample70.png

sample70.png

Policeman

The sample70.rb worked well with Shoes-0.r1263