summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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