5 top = TkFrame.new(root) {
9 msg = TkMessage.new(top) {
10 text "File main.c hasn't been saved to disk since \
11 it was last modified. What should I do?"
14 font '-Adobe-helvetica-medium-r-normal--*-240*'
15 pack('padx'=>5, 'pady'=>5, 'expand'=>'yes')
17 top.pack('fill'=>'both')
20 bot = TkFrame.new(root) {
25 TkFrame.new(bot) { |left|
28 pack('side'=>'left', 'expand'=>'yes', 'padx'=>10, 'pady'=> 10)
32 pack('expand'=>'yes','padx'=>6,'pady'=> 6)
33 top.bind "Enter", proc{state 'active'}
34 msg.bind "Enter", proc{state 'active'}
35 bot.bind "Enter", proc{state 'active'}
36 top.bind "Leave", proc{state 'normal'}
37 msg.bind "Leave", proc{state 'normal'}
38 bot.bind "Leave", proc{state 'normal'}
39 Tk.root.bind "ButtonRelease-1", proc{quit 'save'}
40 Tk.root.bind "Return", proc{quit 'save'}
46 pack('side'=>'left', 'expand'=>'yes', 'padx'=>10)
49 text "Return To Editor"
50 command "quit 'return'"
51 pack('side'=>'left', 'expand'=>'yes', 'padx'=>10)
54 root.pack('side'=>'top', 'fill'=>'both', 'expand'=>'yes')
57 print "You pressed the \"#{button}\" button; bye-bye!\n"