removing trash from zarchive.rb
[zip-doc.git] / gui.rb
blobfc807a51b077dbf6fc3fce69b594c9ff5ba50e59
1 # Part of the zip-doc suite
2 # By Stian Haklev (shaklev@gmail.com), 2007
3 # Released under MIT and GPL licenses
5 require 'tk' 
6 require 'tk/wm'
7 class GUI
9   def initialize
10     ph = { 'padx' => 10, 'pady' => 10 }     # common options
11     open = proc {`open http://localhost:2042/`}
12     leave = proc {
13       H.stop
14       exit(0)
15     }
16     
17     root = TkRoot.new { title "Wikipedia Offline Server" }
18 #    top::Wm.focusmodel('active')
19     top = TkFrame.new(root)
20     TkLabel.new(top) {text    'The Wikipedia Server is now running.' ; pack(ph) }
21     TkLabel.new(top) {text    'It is available through http://localhost:2042/' ; pack(ph) }
23     TkButton.new(top) {text 'Open default webbrowser'; command open; pack ph}
24     TkButton.new(top) {text 'Exit'; command leave; pack ph}
25     top.pack('fill'=>'both', 'side' =>'top')
26   end
27 end