summaryrefslogtreecommitdiffstats
path: root/ext/tk/sample/tkextlib
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-07-08 16:50:07 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-07-08 16:50:07 +0000
commitf8b4ca3c66280f1a4616c788f394e778b0befb09 (patch)
tree1dfea1caef689bef9a36345bd72000ccd3eb58f8 /ext/tk/sample/tkextlib
parentc14d5e4b717d8ea083c00a4b599b5b175b9faea0 (diff)
downloadruby-f8b4ca3c66280f1a4616c788f394e778b0befb09.tar.gz
ruby-f8b4ca3c66280f1a4616c788f394e778b0befb09.tar.xz
ruby-f8b4ca3c66280f1a4616c788f394e778b0befb09.zip
* ext/tk/lib : bug fix
* ext/tk/lib/tkextlib/itcl : add [incr Tcl] support * ext/tk/lib/tkextlib/itk : add [incr Tk] support * ext/tk/lib/tkextlib/iwidgets : midway point of [incr Widgets] support * ext/tk/sample/tkextlib/iwidgets : very simple examples of [incr Widgets] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/sample/tkextlib')
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/clear.gifbin0 -> 279 bytes
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/buttonbox.rb22
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/calendar.rb10
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/canvasprintbox.rb8
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/canvasprintdialog.rb8
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/checkbox.rb12
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/combobox.rb32
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/dateentry.rb7
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/datefield.rb8
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/dialog.rb20
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/dialogshell.rb14
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/disjointlistbox.rb16
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/entryfield-1.rb39
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/entryfield-2.rb40
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/entryfield-3.rb40
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/extbutton.rb20
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/extfileselectionbox.rb8
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/extfileselectiondialog.rb29
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/feedback.rb10
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/fileselectionbox.rb8
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/fileselectiondialog.rb28
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/labeledwidget.rb13
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/shell.rb17
23 files changed, 409 insertions, 0 deletions
diff --git a/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/clear.gif b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/clear.gif
new file mode 100644
index 000000000..bd45628aa
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/clear.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/buttonbox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/buttonbox.rb
new file mode 100644
index 000000000..2b7cd4520
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/buttonbox.rb
@@ -0,0 +1,22 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+# sample 1
+p bb1 = Tk::Iwidgets::Buttonbox.new
+p bb1.add('Yes', :text=>'Yes', :command=>proc{puts 'Yes'})
+p bb1.add('No', :text=>'No', :command=>proc{puts 'No'})
+p bb1.add('Maybe', :text=>'Maybe', :command=>proc{puts 'Maybe'})
+bb1.default('Yes')
+bb1.pack(:expand=>true, :fill=>:both, :pady=>5)
+print "\n"
+
+# sample 2
+p bb2 = Tk::Iwidgets::Buttonbox.new
+p btn1 = bb2.add(:text=>'Yes', :command=>proc{puts 'Yes'})
+p btn2 = bb2.add(:text=>'No', :command=>proc{puts 'No'})
+p btn3 = bb2.add(:text=>'Maybe', :command=>proc{puts 'Maybe'})
+bb2.default(btn1)
+bb2.pack(:expand=>true, :fill=>:both, :pady=>5)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/calendar.rb b/ext/tk/sample/tkextlib/iwidgets/sample/calendar.rb
new file mode 100644
index 000000000..7a7c65ae8
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/calendar.rb
@@ -0,0 +1,10 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+Tk::Iwidgets::Calendar.new(:command=>proc{|arg| puts(arg.date)},
+ :weekendbackground=>'mistyrose',
+ :weekdaybackground=>'ghostwhite',
+ :outline=>'black', :startday=>'wednesday',
+ :days=>%w(We Th Fr Sa Su Mo Tu)).pack
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/canvasprintbox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/canvasprintbox.rb
new file mode 100644
index 000000000..c7c043000
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/canvasprintbox.rb
@@ -0,0 +1,8 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+Tk::Iwidgets::Canvasprintbox.new(:orient=>:landscape, :stretch=>1) \
+ .pack(:padx=>10, :pady=>10, :fill=>:both, :expand=>true)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/canvasprintdialog.rb b/ext/tk/sample/tkextlib/iwidgets/sample/canvasprintdialog.rb
new file mode 100644
index 000000000..ea8d63e6e
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/canvasprintdialog.rb
@@ -0,0 +1,8 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+Tk::Iwidgets::Canvasprintdialog.new.activate
+
+Tk.mainloop
+
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/checkbox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/checkbox.rb
new file mode 100644
index 000000000..bae0eba73
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/checkbox.rb
@@ -0,0 +1,12 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+cb = Tk::Iwidgets::Checkbox.new
+cb.add('bold', :text=>'Bold')
+cb.add('italic', :text=>'Italic')
+cb.add('underline', :text=>'Underline')
+cb.select('underline')
+cb.pack(:expand=>true, :fill=>:both, :padx=>10, :pady=>10)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/combobox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/combobox.rb
new file mode 100644
index 000000000..5c2e6cbbd
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/combobox.rb
@@ -0,0 +1,32 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+#
+# Non-editable Dropdown Combobox
+#
+cb1 = Tk::Iwidgets::Combobox.new(:labeltext=>'Month:',
+ :selectioncommand=>proc{
+ puts(cb1.get_curselection)
+ },
+ :editable=>false, :listheight=>185,
+ :popupcursor=>'hand1')
+
+cb1.insert_list('end', *%w(Jan Feb Mar Apr May June Jul Aug Sept Oct Nov Dec))
+
+
+#
+# Editable Dropdown Combobox
+#
+cb2 = Tk::Iwidgets::Combobox.new(:labeltext=>'Operating System:',
+ :selectioncommand=>proc{
+ puts(cb2.get_curselection)
+ })
+
+cb2.insert_list('end', *%w(Linux HP-UX SunOS Solaris Irix))
+cb2.insert_entry('end', 'L')
+
+cb1.pack(:padx=>10, :pady=>10, :fill=>:x)
+cb2.pack(:padx=>10, :pady=>10, :fill=>:x)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/dateentry.rb b/ext/tk/sample/tkextlib/iwidgets/sample/dateentry.rb
new file mode 100644
index 000000000..572787921
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/dateentry.rb
@@ -0,0 +1,7 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+Tk::Iwidgets::Dateentry.new.pack
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/datefield.rb b/ext/tk/sample/tkextlib/iwidgets/sample/datefield.rb
new file mode 100644
index 000000000..12d498245
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/datefield.rb
@@ -0,0 +1,8 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+df = Tk::Iwidgets::Datefield.new(:command=>proc{puts(df.get)})
+df.pack(:fill=>:x, :expand=>true, :padx=>10, :pady=>10)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/dialog.rb b/ext/tk/sample/tkextlib/iwidgets/sample/dialog.rb
new file mode 100644
index 000000000..3449cd4b3
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/dialog.rb
@@ -0,0 +1,20 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+Thread.new{Tk.mainloop}
+
+d = Tk::Iwidgets::Dialog.new(:modality=>:application)
+
+d.buttonconfigure('OK', :command=>proc{puts 'OK'; d.deactivate true})
+d.buttonconfigure('Apply', :command=>proc{puts 'Apply'})
+d.buttonconfigure('Cancel', :command=>proc{puts 'Cancel'; d.deactivate false})
+d.buttonconfigure('Help', :command=>proc{puts 'Help'})
+
+TkListbox.new(d.child_site, :relief=>:sunken).pack(:expand=>true, :fill=>:both)
+
+if TkComm.bool(d.activate)
+ puts "Exit via OK button"
+else
+ puts "Exit via Cancel button"
+end
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/dialogshell.rb b/ext/tk/sample/tkextlib/iwidgets/sample/dialogshell.rb
new file mode 100644
index 000000000..d4578297e
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/dialogshell.rb
@@ -0,0 +1,14 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+ds = Tk::Iwidgets::Dialogshell.new(:modality=>:none)
+
+ds.add('OK', :text=>'OK', :command=>proc{puts 'OK'; ds.deactivate})
+ds.add('Cancel', :text=>'Cancel', :command=>proc{puts 'Cancel'; ds.deactivate})
+ds.default('OK')
+
+TkButton.new(:text=>'ACTIVATE', :padx=>7, :pady=>7,
+ :command=>proc{puts ds.activate}).pack(:padx=>10, :pady=>10)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/disjointlistbox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/disjointlistbox.rb
new file mode 100644
index 000000000..f7a0e5c48
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/disjointlistbox.rb
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+djl = Tk::Iwidgets::Disjointlistbox.new.pack(:fill=>:both, :expand=>true,
+ :padx=>10, :pady=>10)
+djl.set_lhs(*[0,2,4,5])
+djl.set_rhs(3,6)
+
+djl.insert_lhs(1,7,8)
+djl.insert_rhs(9)
+
+p djl.get_lhs
+p djl.get_rhs
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-1.rb b/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-1.rb
new file mode 100644
index 000000000..24253fcb9
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-1.rb
@@ -0,0 +1,39 @@
+#!/usr/bin/env ruby
+#########################################################
+#
+# use Tk::UTF8_String() for a utf8 charecter
+#
+#########################################################
+require 'tk'
+require 'tkextlib/iwidgets'
+
+TkOption.add('*textBackground', 'white')
+
+ef = Tk::Iwidgets::Entryfield.new(:command=>proc{puts "Return Pressed"})
+
+fef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Fixed:',
+ :fixed=>10, :width=>12)
+
+nef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Numeric:',
+ :validate=>:numeric, :width=>12)
+
+aef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Alphabetic:',
+ :validate=>:alphabetic, :width=>12,
+ :invalid=>proc{
+ puts "Alphabetic contents invalid"
+ })
+
+pef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Password:', :width=>12,
+ :show=>Tk::UTF8_String("\267"),
+ ## <=== utf8 character
+ :command=>proc{puts "Return Pressed"})
+
+Tk::Iwidgets::Labeledwidget.alignlabels(ef, fef, nef, aef, pef)
+
+ef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+fef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+nef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+aef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+pef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-2.rb b/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-2.rb
new file mode 100644
index 000000000..9a80e4aaf
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-2.rb
@@ -0,0 +1,40 @@
+#!/usr/bin/env ruby
+#########################################################
+#
+# set $KCODE to 'utf' for a utf8 charecter
+#
+#########################################################
+$KCODE='utf'
+
+require 'tk'
+require 'tkextlib/iwidgets'
+
+TkOption.add('*textBackground', 'white')
+
+ef = Tk::Iwidgets::Entryfield.new(:command=>proc{puts "Return Pressed"})
+
+fef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Fixed:',
+ :fixed=>10, :width=>12)
+
+nef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Numeric:',
+ :validate=>:numeric, :width=>12)
+
+aef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Alphabetic:',
+ :validate=>:alphabetic, :width=>12,
+ :invalid=>proc{
+ puts "Alphabetic contents invalid"
+ })
+
+pef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Password:', :width=>12,
+ :show=>"\267", ## <=== utf8 character
+ :command=>proc{puts "Return Pressed"})
+
+Tk::Iwidgets::Labeledwidget.alignlabels(ef, fef, nef, aef, pef)
+
+ef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+fef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+nef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+aef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+pef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-3.rb b/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-3.rb
new file mode 100644
index 000000000..e83030839
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-3.rb
@@ -0,0 +1,40 @@
+#!/usr/bin/env ruby
+#########################################################
+#
+# set Tk.encoding = 'utf-8' for a utf8 charecter
+#
+#########################################################
+require 'tk'
+require 'tkextlib/iwidgets'
+
+Tk.encoding = 'utf-8'
+
+TkOption.add('*textBackground', 'white')
+
+ef = Tk::Iwidgets::Entryfield.new(:command=>proc{puts "Return Pressed"})
+
+fef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Fixed:',
+ :fixed=>10, :width=>12)
+
+nef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Numeric:',
+ :validate=>:numeric, :width=>12)
+
+aef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Alphabetic:',
+ :validate=>:alphabetic, :width=>12,
+ :invalid=>proc{
+ puts "Alphabetic contents invalid"
+ })
+
+pef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Password:', :width=>12,
+ :show=>"\267", ## <=== utf8 character
+ :command=>proc{puts "Return Pressed"})
+
+Tk::Iwidgets::Labeledwidget.alignlabels(ef, fef, nef, aef, pef)
+
+ef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+fef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+nef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+aef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+pef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/extbutton.rb b/ext/tk/sample/tkextlib/iwidgets/sample/extbutton.rb
new file mode 100644
index 000000000..83a6a07b6
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/extbutton.rb
@@ -0,0 +1,20 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+Tk::Iwidgets::Extbutton.new(:text=>'Bitmap example', :bitmap=>'info',
+ :background=>'bisque', :activeforeground=>'red',
+ :bitmapforeground=>'blue', :defaultring=>true,
+ :command=>proc{
+ puts "Bisque is beautiful"
+ }).pack(:expand=>true)
+
+#img = TkPhotoImage.new(:file=>File.join(File.dirname(File.expand_path(__FILE__)), '../../../images/earthris.gif'))
+img = TkPhotoImage.new(:file=>File.join(File.dirname(File.expand_path(__FILE__)), '../catalog_demo/images/clear.gif'))
+
+Tk::Iwidgets::Extbutton.new(:text=>'Image example', :relief=>:ridge,
+ :image=>img, :imagepos=>:e, :font=>'9x15bold',
+ :activebackground=>'lightyellow',
+ :background=>'lightgreen').pack(:expand=>true)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/extfileselectionbox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/extfileselectionbox.rb
new file mode 100644
index 000000000..ef3b14ff4
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/extfileselectionbox.rb
@@ -0,0 +1,8 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+Tk::Iwidgets::Extfileselectionbox.new.pack(:padx=>10, :pady=>10,
+ :fill=>:both, :expand=>true)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/extfileselectiondialog.rb b/ext/tk/sample/tkextlib/iwidgets/sample/extfileselectiondialog.rb
new file mode 100644
index 000000000..80a31d06e
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/extfileselectiondialog.rb
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+mainloop = Thread.new{Tk.mainloop}
+
+#
+# Non-modal example
+#
+nmfsd = Tk::Iwidgets::Extfileselectiondialog.new(:title=>'Non-Modal')
+nmfsd.buttonconfigure('OK', :command=>proc{
+ puts "You selected #{nmfsd.get}"
+ nmfsd.deactivate
+ })
+nmfsd.activate
+
+#
+# Modal example
+#
+mfsd = Tk::Iwidgets::Extfileselectiondialog.new(:modality=>:application)
+mfsd.center
+if TkComm.bool(mfsd.activate)
+ puts "You selected #{mfsd.get}"
+else
+ puts "You cancelled the dialog"
+end
+
+
+mainloop.join
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/feedback.rb b/ext/tk/sample/tkextlib/iwidgets/sample/feedback.rb
new file mode 100644
index 000000000..c39ebd9d2
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/feedback.rb
@@ -0,0 +1,10 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+Tk::Iwidgets::Feedback.new(:labeltext=>'Status', :steps=>20){|fb|
+ pack(:padx=>10, :pady=>10, :fill=>:both, :expand=>true)
+ TkTimer.new(500, 20, proc{fb.step}).start(5000)
+}
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/fileselectionbox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/fileselectionbox.rb
new file mode 100644
index 000000000..f0313d948
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/fileselectionbox.rb
@@ -0,0 +1,8 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+Tk::Iwidgets::Fileselectionbox.new.pack(:padx=>10, :pady=>10,
+ :fill=>:both, :expand=>true)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/fileselectiondialog.rb b/ext/tk/sample/tkextlib/iwidgets/sample/fileselectiondialog.rb
new file mode 100644
index 000000000..955e5cbd2
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/fileselectiondialog.rb
@@ -0,0 +1,28 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+mainloop = Thread.new{Tk.mainloop}
+
+#
+# Non-modal example
+#
+nmfsd = Tk::Iwidgets::Fileselectiondialog.new(:title=>'Non-Modal')
+nmfsd.buttonconfigure('OK', :command=>proc{
+ puts "You selected #{nmfsd.get}"
+ nmfsd.deactivate
+ })
+nmfsd.activate
+
+#
+# Modal example
+#
+mfsd = Tk::Iwidgets::Fileselectiondialog.new(:modality=>:application)
+mfsd.center
+if TkComm.bool(mfsd.activate)
+ puts "You selected #{mfsd.get}"
+else
+ puts "You cancelled the dialog"
+end
+
+mainloop.join
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/labeledwidget.rb b/ext/tk/sample/tkextlib/iwidgets/sample/labeledwidget.rb
new file mode 100644
index 000000000..1fed7d55e
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/labeledwidget.rb
@@ -0,0 +1,13 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+lw = Tk::Iwidgets::Labeledwidget.new(:labeltext=>'Canvas Widget',
+ :labelpos=>:s)
+lw.pack(:fill=>:both, :expand=>true, :padx=>10, :pady=>10)
+
+cw = TkCanvas.new(lw.child_site, :relief=>:raised, :width=>200, :height=>200,
+ :borderwidth=>3, :background=>:white)
+cw.pack(:padx=>10, :pady=>10)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/shell.rb b/ext/tk/sample/tkextlib/iwidgets/sample/shell.rb
new file mode 100644
index 000000000..850ddb29d
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/shell.rb
@@ -0,0 +1,17 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+sh = Tk::Iwidgets::Shell.new(:modality=>:application,
+ :padx=>20, :pady=>20, :title=>'Shell')
+
+TkButton.new(:text=>'ACTIVATE', :padx=>7, :pady=>7,
+ :command=>proc{puts sh.activate}).pack(:padx=>10, :pady=>10)
+
+TkLabel.new(sh.child_site, :text=>'SHELL').pack
+TkButton.new(sh.child_site, :text=>'YES',
+ :command=>proc{sh.deactivate 'press YES'}).pack(:fill=>:x)
+TkButton.new(sh.child_site, :text=>'NO',
+ :command=>proc{sh.deactivate 'press NO'}).pack(:fill=>:x)
+
+Tk.mainloop