1 # Copyright (c) 2009 Paolo Capriotti <p.capriotti@gmail.com>
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
8 class Window < Qt::Widget
9 def initialize(parent = nil)
12 quit = Qt::PushButton.new("Quit", self)
13 connect(quit, SIGNAL(:clicked),
16 start_button = Qt::PushButton.new("Start", self)
17 start_button.on(:clicked) { start }
19 layout = Qt::VBoxLayout.new
20 layout.add_widget start_button
21 layout.add_widget quit
24 @conn = ICS::Connection.new('freechess.org', 5000)
25 r = lambda do |text, off|
26 puts "received (#{off}): #{text}"
28 @conn.on(:received_line, &r)
29 @conn.on(:received_text, &r)