summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBertrand Jacquin (Beber) <beber.mailing@gmail.com>2006-06-04 18:50:03 +0200
committerbeber <beber@meathook.melee>2006-06-04 18:50:03 +0200
commit28226ce09d3b93c05a5da32221610353016869c5 (patch)
treeaf2eb2fa1b62b8b485c0737c1b33775561c0f163
parentruby: get xml from moules.org and show it (diff)
downloadwmhuitrehuitre-28226ce09d3b93c05a5da32221610353016869c5.tar.gz
ruby: show the interface before getting web infosHEADmaster
-rwxr-xr-xruby/wmHuitreHuitre.rb13
1 files changed, 6 insertions, 7 deletions
diff --git a/ruby/wmHuitreHuitre.rb b/ruby/wmHuitreHuitre.rb
index 537ccfb..a7050c2 100755
--- a/ruby/wmHuitreHuitre.rb
+++ b/ruby/wmHuitreHuitre.rb
@@ -44,6 +44,7 @@ menu.append(mn_aide)
entry_box = Gtk::Entry.new()
bouton = Gtk::Button.new("Send", false)
dialog_box = Gtk::ScrolledWindow.new()
+dialog_box.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC)
table.attach(menu, 0, 2, 0, 1, Gtk::FILL | Gtk::EXPAND, 0, 0, 0)
table.attach(entry_box, 0, 1, 2, 3, Gtk::FILL | Gtk::EXPAND, 0, 0, 0)
@@ -54,16 +55,14 @@ text = Gtk::TextView.new()
buf = Gtk::TextBuffer.new()
text.set_editable(false)
+dialog_box << text
+
+interface.show_all
+
Net::HTTP.start(hostname) do |http|
response = http.get(path, {'User-Agent' => 'wmHuitreHuitre/0.1'})
buf.set_text(response.body)
+ text.set_buffer(buf)
end
-text.set_buffer(buf)
-
-dialog_box.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC)
-
-dialog_box << text
-
-interface.show_all
Gtk.main