1#!/usr/bin/env ruby
2require 'tk'
3require 'tkextlib/iwidgets'
4
5mw = Tk::Iwidgets::Mainwindow.new
6
7mw.menubar.add(:menubutton, 'file', :text=>'File', :underline=>0,
8               :padx=>8, :pady=>2, :menu=>[
9                 [:options, {:tearoff=>false}],
10
11                 [:command, 'new', {
12                     :label=>'New', :underline=>0,
13                     :helpstr=>'Create a new file'
14                   }
15                 ],
16
17                 [:command, 'open', {
18                     :label=>'Open ...', :underline=>0,
19                     :helpstr=>'Open an existing file'
20                   }
21                 ],
22
23                 [:command, 'save', {
24                     :label=>'Save', :underline=>0,
25                     :helpstr=>'Save the current file'
26                   }
27                 ],
28
29                 [:command, 'saveas', {
30                     :label=>'Save As', :underline=>5,
31                     :helpstr=>'Save the file as a different name'
32                   }
33                 ],
34
35                 [:command, 'print', {
36                     :label=>'Print', :underline=>0,
37                     :helpstr=>'Print the file'
38                   }
39                 ],
40
41                 [:separator, 'sep1'],
42
43                 [:command, 'close', {
44                     :label=>'Close', :underline=>0,
45                     :helpstr=>'Close the file'
46                   }
47                 ],
48
49                 [:separator, 'sep2'],
50
51                 [:command, 'exit', {
52                     :label=>'Exit', :underline=>1,
53                     :helpstr=>'Exit this application'
54                   }
55                 ],
56
57                 nil
58               ])
59
60Tk::Iwidgets::Scrolledtext.new(mw.child_site).pack(:fill=>:both, :expand=>true)
61
62mw.activate
63
64Tk.mainloop
65