summaryrefslogtreecommitdiff
path: root/ext/tk/sample/demos-en/widget
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-10 20:59:10 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-10 20:59:10 +0000
commite6697a6405f1330ef071220396b8afef1cd1079a (patch)
tree3511a2ec3157a1b4d931153e84dbcae1c2fdd32a /ext/tk/sample/demos-en/widget
parentaf0c875e26280869f216f69608919a8c721e4c68 (diff)
* ext/tk/tcltklib.c: SEGV when tcltk-stubs is enabled.
* ext/tk/tcltklib.c: avoid error on a shared object. * ext/tk/extconf.rb: support --with-tcltkversion * ext/tk/README.tcltklib: add document about --with-tcltkversion * ext/tk/lib/tk.rb, ext/tk/lib/multi-tk.rb, ext/tk/lib/remote-tk.rb: not work on $SAFE==4 * ext/tk/lib/multi-tk.rb: Object#methods returns Symbols on Ruby1.9. * ext/tk/lib/tk/timer.rb: add TkTimer#at_end(proc) to register the procedure which called at end of the timer. * ext/tk/lib/tk.rb, ext/tk/lib/tk/itemfont.rb, ext/tk/lib/font.rb: support __IGNORE_UNKNOWN_CONFIGURE_OPTION__ about font options. * ext/tk/lib/*: treat __IGNORE_UNKNOWN_CONFIGURE_OPTION__ * ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb, ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb, ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb: bug fix. * ext/tk/lib/tk/text.rb: typo. call a wrong method. * ext/tk/lib/tk/itemconfig.rb: ditto. * ext/tk/lib/tk.rb, ext/tk/lib/tk/itemconfig.rb, ext/tk/lib/tk/canvas.rb: support alias names of option keys. * ext/tk/lib/tk/grid.rb: lack of module-method definitions. * ext/tk/lib/tk/pack.rb, ext/tk/lib/tk/grid.rb: increase supported parameter patterns of configure method. * ext/tk/lib/tk.rb: add TkWindow#grid_anchor, grid_column, grid_row. * ext/tk/lib/tk/wm.rb: methods of Tk::Wm_for_General module cannot pass the given block to methods of Tk::Wm module. * ext/tk/lib/tk/wm.rb: Wm#overrideredirect overwrites arguemnt to an invalid value. * ext/tk/lib/tk.rb: fix memory (object) leak bug. * ext/tk/tcltklib.c, ext/tk/tkutil/tkutil.c: fix memory leak. * ext/tk/sample/demos-jp/aniwave.rb, ext/tk/sample/demos-en/aniwave.rb: bug fix. * ext/tk/lib/tkextlib/blt/component.rb, ext/tk/lib/tkextlib/tile/tentry.rb, ext/tk/lib/tkextlib/tile/treeview.rb: ditto. * ext/tk/lib/tkextlib/tile/tpaned.rb: improve TPaned#add. * ext/tk/sample/demos-jp/widget, ext/tk/sample/demos-en/widget, ext/tk/sample/demos-jp/style.rb, ext/tk/sample/demos-en/style.rb, ext/tk/sample/demos-jp/bind.rb, ext/tk/sample/demos-en/bind.rb: bug fix. * ext/tk/sample/ttk_wrapper.rb: ditto. * ext/tk/sample/ttk_wrapper.rb: support "if __FILE__ == $0" idiom. * ext/tk/sample/tktextio.rb: add binding for 'Ctrl-u' at console mode. * ext/tk/lib/tkextlib/tile.rb, ext/tk/lib/tkextlib/tile/style.rb, ext/tk/sample/ttk_wrapper.rb: improve treating and control themes. add Tk::Tile.themes and Tk::Tile.set_theme(theme). * ext/tk/lib/tkextlib/tile.rb: lack of autoload definitions. * ext/tk/lib/tkextlib/tile/tnotebook.rb: cannot use kanji (not UTF-8) characters for headings. * ext/tk/lib/tkextlib/tkDND/shape.rb: wrong package name. * ext/tk/tkutil/tkutil.c: improve handling callback-subst-keys. Now, support longnam-keys (e.g. '%CTT' on tkdnd-2.0; however, still not support tkdnd-2.0 on tkextlib), and symbols of parameters (e.g. :widget=>'%W', :keycode=>'%k', '%x'=>:x, '%X'=>:root_x, and so on; those are attributes of event object). It means that Ruby/Tk accepts not only "widget.bind(ev, '%W', '%k', ...){|w, k, ...| ... }", but also "widget.bind(ev, :widget, :keycode, ...){|w, k, ...| ... }". It is potentially incompatible, when user passes symbols to the arguments of the callback block (the block receives the symbols as strings). I think that is very rare case (probably, used by Ruby/Tk experts only). When causes such trouble, please give strings instead of such symbol parameters (e.g. call Symbol#to_s method). * ext/tk/lib/tk/event.rb, ext/tk/lib/tk/validation.rb, ext/tk/lib/tkextlib/blt/treeview.rb, ext/tk/lib/tkextlib/winico/winico.rb: ditto. * ext/tk/tkutil/tkutil.c: strings are available on subst_tables on TkUtil::CallbackSubst class (it is useful on Ruby 1.9). * ext/tk/lib/tk/spinbox.rb, ext/tk/lib/tkextlib/iwidgets/hierarchy.rb, ext/tk/lib/tkextlib/iwidgets/spinner.rb, ext/tk/lib/tkextlib/iwidgets/entryfield.rb, ext/tk/lib/tkextlib/iwidgets/calendar.rb, ext/tk/lib/tkextlib/blt/dragdrop.rb, ext/tk/lib/tkextlib/tkDND/tkdnd.rb, ext/tk/lib/tkextlib/treectrl/tktreectrl.rb, ext/tk/lib/tkextlib/tktable/tktable.rb: disable code piece became unnecessary by reason of the changes of ext/tk/tkutil/tkutil.c. * ext/tk/lib/tk.rb, ext/tk/lib/multi-tk.rb: change strategy to define the constant WITH_ENCODING. * ext/tk/lib/tk.rb: fix bug on Tk::Encoding.tk_encoding_names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/sample/demos-en/widget')
-rw-r--r--ext/tk/sample/demos-en/widget204
1 files changed, 163 insertions, 41 deletions
diff --git a/ext/tk/sample/demos-en/widget b/ext/tk/sample/demos-en/widget
index 391d8532b6..9a0605d8b9 100644
--- a/ext/tk/sample/demos-en/widget
+++ b/ext/tk/sample/demos-en/widget
@@ -14,6 +14,8 @@ require 'tk'
### $DEBUG=1 ##########
+$RubyTk_WidgetDemo = true
+
#----------------------------------------------------------------
# The code below create the main window, consisting of a menu bar
# and a text widget that explains how to use the program, plus lists
@@ -103,14 +105,22 @@ EOD
end
#
-TkMenubar.new($root,
- [[['File', 0],
- ['About ... ', proc{aboutBox}, 0, '<F1>'],
- '---',
- ['Quit', proc{exit}, 0, 'Meta-Q']
- ]]).pack('side'=>'top', 'fill'=>'x')
+if $tk_major_ver >= 8
+ $root.add_menubar([[['File', 0],
+ ['About ... ', proc{aboutBox}, 0, '<F1>'],
+ '---',
+ ['Quit', proc{exit}, 0, 'Ctrl-Q']
+ ]])
+else
+ TkMenubar.new($root,
+ [[['File', 0],
+ ['About ... ', proc{aboutBox}, 0, '<F1>'],
+ '---',
+ ['Quit', proc{exit}, 0, 'Ctrl-Q']
+ ]]).pack('side'=>'top', 'fill'=>'x')
+end
$root.bind('F1', proc{aboutBox})
-$root.bind('Meta-q', proc{exit})
+$root.bind('Control-q', proc{exit})
=begin
TkFrame.new($root){|frame|
@@ -257,7 +267,10 @@ the demonstration. Once the demonstration window appears, you can \
click the "See Code" button to see the Ruby/Tk code that created the \
demonstration. If you wish, you can edit the code and click the \
"Rerun Demo" button in the code window to reinvoke the demonstration \
-with the modified code.
+with the modified code. \
+Don't worry about breaking the source code. \
+Your modifications are not reflected on the original file. \
+Please try many kind of changes.
Some demo scripts require the recent version of Tk library \
(e.g. Tk8.4 or later) \
@@ -266,6 +279,20 @@ required by the demo script, the demo doesn't work. \
In such a case, please re-compile tcltklib with the later Tk library \
which supports the required functions.
+If your Tk supports Ttk (Tile) extension (included or installed), \
+please try the demo of Ttk extension (sample/tkextlib/tile/demo.rb) too.
+( Probably, Ttk extension \
+#{
+begin
+ require 'tkextlib/tile'
+ "is already installed on your environment"
+rescue
+ "is not installed on your environment yet"
+end
+}\
+. )
+Ttk extension is a standard feature of Tk8.5 or later.
+
EOT
@@ -299,6 +326,8 @@ txt.insert('end', "13. A simple user interface for viewing images. (if supported
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "14. Labelled frames (if supported)\n", tag_demo, "demo-labelframe")
txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "15. The simple Themed Tk widgets (require Tile/Ttk extension)\n", tag_demo, "demo-ttkbut")
+txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "\n")
txt.insert('end', "Listboxes\n", tag_title)
@@ -309,6 +338,10 @@ txt.insert('end', "2. Colors: change the color scheme for the application.\n", "
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "3. A collection of famous sayings.\n", tag_demo, "demo-sayings")
txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "4. A multi-column list of contries. (require Tile/Ttk extension)\n", tag_demo, "demo-mclist")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "5. A directory browser tree. (require Tile/Ttk extension)\n", tag_demo, "demo-tree")
+txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "\n")
txt.insert('end', "Entries and Spin-boxes\n", tag_title)
@@ -323,7 +356,9 @@ txt.insert('end',
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "4. Spin-boxes. (if supported)\n", tag_demo, "demo-spin")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "5. Simple Rolodex-like form.\n", tag_demo, "demo-form")
+txt.insert('end', "5. Combo-boxes. (require Tile/Ttk extension)\n", tag_demo, "demo-combo")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "6. Simple Rolodex-like form.\n", tag_demo, "demo-form")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "\n")
@@ -363,31 +398,43 @@ txt.insert('end', "7. A building floor plan. (another way to create canvas items
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "8. A simple scrollable canvas.\n", tag_demo, "demo-cscroll")
txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "9. A Knight's tour of the chess board. (require Tile/Ttk extension)\n", tag_demo, "demo-knightstour")
+txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "\n")
-txt.insert('end', "Scales\n", tag_title)
+txt.insert('end', "Scales and Progress Bars\n", tag_title)
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "1. Vertical scale.\n", tag_demo.id, "demo-vscale")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "2. Horizontal scale.\n", tag_demo.id, "demo-hscale")
txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "3. Progress bar. (require Tile/Ttk extension)\n", tag_demo.id, "demo-ttkprogress")
+txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "\n")
-txt.insert('end', "Paned Windows\n", tag_title)
+txt.insert('end', "Paned Windows and Notebooks\n", tag_title)
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "1. Horizontal paned window. (if supported)\n", tag_demo.id, "demo-paned1")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "2. Vertical paned window. (if supported)\n", tag_demo.id, "demo-paned2")
txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "3. Themed nested panes. (require Tile/Ttk extension)\n", tag_demo.id, "demo-ttkpane")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "4. Notebook widget. (require Tile/Ttk extension)\n", tag_demo.id, "demo-ttknote")
+txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "\n")
-txt.insert('end', "Menus\n", tag_title)
+txt.insert('end', "Menus and Toolbars\n", tag_title)
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "1. Menus and cascades.\n", tag_demo, "demo-menu")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "2. Menus and cascades. (if supported)\n", tag_demo, "demo-menu84")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "3. Menubuttons\n", tag_demo, "demo-menubu")
+txt.insert('end', "3. Menubuttons.\n", tag_demo, "demo-menubu")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "4. Themed menu buttons. (require Tile/Ttk extension)\n", tag_demo, "demo-ttkmenu")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "5. Themed toolbar. (require Tile/Ttk extension)\n", tag_demo, "demo-toolbar")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "\n")
@@ -395,9 +442,11 @@ txt.insert('end', "Common Dialogs\n", tag_title)
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "1. Message boxes.\n", tag_demo, "demo-msgbox")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "2. File selection dialog.\n", tag_demo, "demo-filebox")
+txt.insert('end', "2. Message boxes with detail text. (if supported)\n", tag_demo, "demo-msgbox2")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "3. Color picker.\n", tag_demo, "demo-clrpick")
+txt.insert('end', "3. File selection dialog.\n", tag_demo, "demo-filebox")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "4. Color picker.\n", tag_demo, "demo-clrpick")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "\n")
@@ -453,7 +502,8 @@ def showVars1(parent, *args)
end
w = TkToplevel.new(parent) {|w|
title "Variable values"
- TkLabel.new(w) {
+ base = TkFrame.new(w).pack(:fill=>:both, :expand=>true)
+ TkLabel.new(base) {
text "Variable values:"
width 20
anchor 'center'
@@ -475,7 +525,7 @@ def showVars1(parent, *args)
.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'x')
}.pack('side'=>'top', 'anchor'=>'w', 'fill'=>'x')
}
- TkButton.new(w) {
+ TkButton.new(base) {
text "OK"
command proc{w.destroy}
}.pack('side'=>'bottom', 'pady'=>2)
@@ -490,10 +540,12 @@ def showVars2(parent, *args)
rescue
end
end
- $showVarsWin[parent.path] = TkToplevel.new(parent) {|w|
+ $showVarsWin[parent.path] = TkToplevel.new(parent) {|top|
title "Variable values"
- TkLabelFrame.new(w, :text=>"Variable values:",
+ base = TkFrame.new(top).pack(:fill=>:both, :expand=>true)
+
+ TkLabelFrame.new(base, :text=>"Variable values:",
:font=>{:family=>'Helvetica', :size=>14}){|f|
args.each{|vnam,vbody|
TkGrid(TkLabel.new(f, :text=>"#{vnam}: ", :anchor=>'w'),
@@ -505,15 +557,15 @@ def showVars2(parent, *args)
f.grid_columnconfig(1, :weight=>1)
f.grid_rowconfig(100, :weight=>1)
}
- TkButton.new(w, :text=>"OK", :width=>8, :default=>:active,
- :command=>proc{w.destroy}){|b|
- w.bind('Return', proc{b.invoke})
- w.bind('Escape', proc{b.invoke})
+ TkButton.new(base, :text=>"OK", :width=>8, :default=>:active,
+ :command=>proc{top.destroy}){|b|
+ top.bind('Return', proc{b.invoke})
+ top.bind('Escape', proc{b.invoke})
b.grid(:sticky=>'e', :padx=>4, :pady=>[6, 4])
}
- w.grid_columnconfig(0, :weight=>1)
- w.grid_rowconfig(0, :weight=>1)
+ base.grid_columnconfig(0, :weight=>1)
+ base.grid_rowconfig(0, :weight=>1)
}
end
@@ -607,10 +659,27 @@ def _null_binding
end
private :_null_binding
-def eval_samplecode(code)
+def eval_samplecode(code, file=nil)
#eval(code)
#_null_binding.pseudo_toplevel_eval{ eval(code) }
- Thread.new{ _null_binding.pseudo_toplevel_eval{ eval(code) } }
+ #Thread.new{ _null_binding.pseudo_toplevel_eval{ eval(code) } }
+ Thread.new{
+ _null_binding.pseudo_toplevel_eval{
+ begin
+ if file
+ eval(code, binding, "(eval:#{file})")
+ else
+ eval(code)
+ end
+ rescue Exception=>e
+ #p e
+ TkBgError.show(e.class.inspect + ': ' + e.message + "\n" +
+ "\n---< backtrace of Ruby side >-----\n" +
+ e.backtrace.join("\n") +
+ "\n---< backtrace of Tk side >-------")
+ end
+ }
+ }
Tk.update
end
@@ -630,7 +699,7 @@ def invoke(txt, idx)
Tk.update
# eval(IO.readlines("#{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb").join, _null_binding)
# Tk.update
- eval_samplecode(IO.readlines("#{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb").join)
+ eval_samplecode(IO.readlines("#{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb").join, tag[5..-1] + '.rb')
txt.cursor(cursor)
$tag_visited.add("#{idx} linestart +1 chars", "#{idx} lineend +1 chars")
@@ -687,20 +756,32 @@ def showCode1(demo)
if $code_window == nil || TkWinfo.exist?($code_window) == false
$code_window = TkToplevel.new(nil)
f = TkFrame.new($code_window)
+
TkButton.new(f) {
text "Dismiss"
command proc{
$code_window.destroy
$code_window = nil
}
- }.pack('side'=>'left', 'expand'=>'yes', 'pady'=>2)
+ }.pack('side'=>'right', 'expand'=>'false', 'pady'=>2, 'padx'=>25)
TkButton.new(f) {
text "Rerun Demo"
# command proc{eval($code_text.get('1.0','end'), _null_binding)}
- command proc{eval_samplecode($code_text.get('1.0','end'))}
- }.pack('side'=>'left', 'expand'=>'yes', 'pady'=>2)
-# f.pack('side'=>'bottom', 'expand'=>'yes', 'fill'=>'x')
- f.pack('side'=>'bottom', 'fill'=>'x')
+ command proc{eval_samplecode($code_text.get('1.0','end'), '<viewer>')}
+ }.pack('side'=>'right', 'expand'=>'false', 'pady'=>2)
+
+ TkLabel.new(f,'text'=>'line:').pack('side'=>'left')
+ linenum =TkLabel.new(f,'text'=>'').pack('side'=>'left')
+ TkLabel.new(f,'text'=>' pos:').pack('side'=>'left')
+ posnum =TkLabel.new(f,'text'=>'').pack('side'=>'left')
+
+ $set_linenum = proc{|w|
+ line, pos = w.index('insert').split('.')
+ linenum.text = line
+ posnum.text = pos
+ }
+
+ f.pack('side'=>'bottom', 'expand'=>'true', 'fill'=>'x')
if $tk_version =~ /^4\.[01]/
s = TkScrollbar.new($code_window, 'orient'=>'vertical')
@@ -745,10 +826,21 @@ def showCode1(demo)
TkGrid.columnconfigure(f, 0, 'weight'=>1, 'minsize'=>0)
}
end
+
+ btag = TkBindTag.new
+
+ btag.bind('Key', $set_linenum, '%W')
+ btag.bind('Button', $set_linenum, '%W')
+
+ btags = $code_text.bindtags
+ btags.insert(btags.index($code_text.class) + 1, btag)
+ $code_text.bindtags = btags
+
else
$code_window.deiconify
$code_window.raise
end
+
$code_window.title("Demo code: #{file}")
$code_window.iconname(file)
# fid = open(file, 'r')
@@ -759,6 +851,9 @@ def showCode1(demo)
#$code_mark = TkTextMark.new($code_text, '1.0')
#$code_text.set_insert('1.0')
TkTextMarkInsert.new($code_text,'1.0')
+
+ $set_linenum.call($code_text)
+
fid.close
end
@@ -779,7 +874,19 @@ def showCode2(demo)
tf.grid_columnconfigure(0, :weight=>1)
bf = TkFrame.new($code_window)
-
+
+ lf = TkFrame.new(bf)
+ TkLabel.new(lf, :text=>'line:').pack(:side=>:left)
+ linenum =TkLabel.new(lf, :text=>'').pack(:side=>:left)
+ TkLabel.new(lf, :text=>' pos:').pack(:side=>:left)
+ posnum =TkLabel.new(lf, :text=>'').pack(:side=>:left)
+
+ $set_linenum = proc{|w|
+ line, pos = w.index('insert').split('.')
+ linenum.text = line
+ posnum.text = pos
+ }
+
b_dis = TkButton.new(bf, :text=>'Dismiss', :default=>:active,
:command=>proc{
$code_window.destroy
@@ -792,12 +899,12 @@ def showCode2(demo)
b_run = TkButton.new(bf, :text=>'Rerun Demo',
:command=>proc{
# eval($code_text.get('1.0','end'), _null_binding)
- eval_samplecode($code_text.get('1.0','end'))
+ eval_samplecode($code_text.get('1.0','end'), '<viewer>')
},
:image=>$image['refresh'], :compound=>:left)
- TkGrid('x', b_run, b_prn, b_dis, :padx=>4, :pady=>[6,4])
- bf.grid_columnconfigure(0, :weight=>1)
+ TkGrid(lf, 'x', b_run, b_prn, b_dis, :padx=>4, :pady=>[6,4])
+ bf.grid_columnconfigure(1, :weight=>1)
TkGrid(tf, :sticky=>'news')
TkGrid(bf, :sticky=>'ew')
@@ -810,6 +917,17 @@ def showCode2(demo)
$code_window.bindinfo('Return').each{|cmd, arg|
$code_window.bind_append('Escape', cmd, arg)
}
+
+ btag = TkBindTag.new
+
+ btag.bind('Key', $set_linenum, '%W')
+ btag.bind('Button', $set_linenum, '%W')
+ btag.bind('Configure', $set_linenum, '%W')
+
+ btags = $code_text.bindtags
+ btags.insert(btags.index($code_text.class) + 1, btag)
+ $code_text.bindtags = btags
+
else
$code_window.deiconify
$code_window.raise
@@ -821,6 +939,9 @@ def showCode2(demo)
$code_text.delete('1.0', 'end')
$code_text.insert('1.0', fid.read)
TkTextMarkInsert.new($code_text,'1.0')
+
+ $set_linenum.call($code_text)
+
fid.close
end
@@ -914,12 +1035,13 @@ end
#
def aboutBox
Tk.messageBox('icon'=>'info', 'type'=>'ok', 'title'=>'About Widget Demo',
- 'message'=>"Ruby/Tk widget demonstration Ver.1.6.3-en\n\n" +
+ 'message'=>"Ruby/Tk widget demonstration Ver.1.7.0-en\n\n" +
"based on demos of Tk8.1 -- 8.5 " +
- "( Copyright:: " +
+ "( Copyright of Tcl/Tk demos:: " +
"(c) 1996-1997 Sun Microsystems, Inc. / " +
"(c) 1997-2000 Ajuba Solutions, Inc. / " +
- "(c) 2001-2003 Donal K. Fellows )\n\n" +
+ "(c) 2001-2007 Donal K. Fellows / " +
+ "(c) 2002-2007 Daniel A. Steffen )\n\n" +
"Your Ruby & Tk Version ::\n" +
"Ruby#{RUBY_VERSION}(#{RUBY_RELEASE_DATE})[#{RUBY_PLATFORM}] / Tk#{$tk_patchlevel}#{(Tk::JAPANIZED_TK)? '-jp': ''}\n\n" +
"Ruby/Tk release date :: tcltklib #{TclTkLib::RELEASE_DATE}; tk #{Tk::RELEASE_DATE}")
@@ -941,7 +1063,7 @@ ARGV.each{|cmd|
end
#eval(IO.readlines("#{[$demo_dir, cmd].join(File::Separator)}.rb").join,
# _null_binding)
- eval_samplecode(IO.readlines("#{[$demo_dir, cmd].join(File::Separator)}.rb").join)
+ eval_samplecode(IO.readlines("#{[$demo_dir, cmd].join(File::Separator)}.rb").join, cmd + '.rb')
}
if no_launcher
$root.withdraw # hide root window