--- iwidgets4.0.1/README	2002-09-13 11:39:48.000000000 -0700
+++ iwidgets4.1/README	2012-09-28 07:05:35.000000000 -0700
@@ -1,212 +1,44 @@
-------------------------------------------------------------------------------
-                    [incr Widgets] - version 4.0.1
-------------------------------------------------------------------------------
-Please send general comments, suggestions, and questions to chad_smith@adc.com
-or itclguy@yahoo.com.  Much of this file was written by Mark Ulferts, the
-original [incr Widgets] guy, several years ago when the Iwidgets were first
-released.  Chad has assumed responsibilities for updates and maintenance.
-
-==============================================================================
-           Copyright (c) 1995   DSC Technologies Corporation
-==============================================================================
- This software is copyrighted by DSC Technologies and private individual 
- contributors.  The copyright holder is specifically listed in the header 
- of each file.  The following terms apply to all files associated with the
- software unless explicitly disclaimed in individual files by private
- contributors.
-  
- Permission to use, copy, modify, distribute and license this software and 
- its documentation for any purpose, and without fee or written agreement 
- with DSC, is hereby granted, provided that the above copyright notice 
- appears in all copies and that both the copyright notice and warranty 
- disclaimer below appear in supporting documentation, and that the names of
- DSC Technologies Corporation or DSC Communications Corporation not be used 
- in advertising or publicity pertaining to the software without specific, 
- written prior permission.
-  
- DSC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND NON-INFRINGEMENT.
- THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND 
- DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
- ENHANCEMENTS, OR MODIFICATIONS. IN NO EVENT SHALL DSC BE LIABLE FOR ANY
- SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
- CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  
- RESTRICTED RIGHTS: Use, duplication or disclosure by the government
- is subject to the restrictions as set forth in subparagraph (c) (1) (ii)
- of the Rights in Technical Data and Computer Software Clause as DFARS
- 252.227-7013 and FAR 52.227-19.
-==============================================================================
-
- OVERVIEW
-------------------------------------------------------------------------------
- - Introduction
- - Distribution
- - Web site
- - Getting started
- - Contributions
- - Acknowledgements
-------------------------------------------------------------------------------
-
-
- Introduction
-------------------------------------------------------------------------------
- [incr Widgets] is an object-oriented mega-widget set which extends 
- Tcl/Tk and is based on [incr Tcl] and [incr Tk].  This set of mega-widgets
- delivers many new, general purpose widgets like option menus, comboboxes, 
- selection boxes, and various dialogs whose couterparts are found in Motif 
- and Windows. Since [incr Widgets] is based on the [incr Tk] extension, the 
- Tk framework of configuration options, widget commands, and default bindings
- is maintained.  In other words, each [incr Widgets] mega-widget seamlessly 
- blends with the standard Tk widgets. They look, act and feel like Tk 
- widgets. In addition, all [incr Widgets] mega-widgets are object oriented and 
- may themselves be extended, using either inheritance or composition.
-
- [incr Widgets] offers a strong object-oriented foundation which addresses 
- the need for a flexible and extensible mega-widget set. Its usage replaces 
- common widget combinations with higher level abstractions, simplifying code,
- reducing errors, increasing readability, adding productivity, and promoting 
- a singular look-and-feel.  The ability to extend [incr Widgets] enables 
- developers to create new mega-widgets based on previous work.
-
- In short, [incr Widgets] is a library of reusable mega-widgets that can 
- be easily extended using composition or inheritance, allowing quicker 
- development of large scale applications. Usage drastically reduces 
- development time. New dialogs can be created in hours. Whole applications 
- in a few days. Reuse becomes a reality. Many projects are benefitting frm
- the intergration of this mega-widget set into their development strategy. 
- [incr Widgets] is an [incr Tcl] and [incr Tk] success story. Good products 
- come from good foundations.
-
-
- Distribution
-------------------------------------------------------------------------------
- The [incr Widgets] distribution may be downloaded at SourceForge:
- www.sourceforge.net/projects/incrtcl.  The current distribution is
- version 4.0.1.
-
-
- Web site
-------------------------------------------------------------------------------
- For the most current news regarding [incr Widgets] please consult the web
- site - http://incrtcl.sourceforge.net/iwidgets.  Many thanks to Brett Schwarz
- who has done an incredible job overhauling this site.  Take a look!
-  
-
- Getting started
-------------------------------------------------------------------------------
- The "doc" directory contains man pages and a technical paper. The man
- pages are installed under the man directory off your --prefix, and as of
- version 4.0.1 are prepended with the text "iwidgets_" to easily differentiate
- [incr Widgets] man pages from those of other extensions.
-
-   doc/iwidgets.ps ... Updated paper presented at Tcl Workshop 95.
-
-   doc/*.n ........... Man pages
-
- The "demos" directory contains demo scripts for each mega-widget as
- well as html versions of all the [incr Widgets] man pages.  The
- demos are also installed under the lib directory off your --prefix.
-
-   demos/catalog ..... Comprehensive demo package which illustrates
-                       [incr Widgets] usage additionally displaying the 
-                       source.
-
-   demos/html    ..... HTML version of the [incr Widgets] man pages.
-
- The "tests" directory contains a set of test scripts for [incr Widgets].
- They also make for a great demo of the flexiblity of the mega-widgets.
-
-
- Installation
-------------------------------------------------------------------------------
-  NOTE: Having the itcl distribution is a prerequsite to using iwidgets.
-  Thus, if you don't have itcl you need to visit Source Forge to download
-  and install it first.  Once you have downloaded and installed [incr Tcl]
-  and [incr Tk], you can proceed with [incr Widgets] installation as follows:
-
-  1)  Copy the iwidgets4.0.1.tar.gz file to your toplevel [incr Tcl]
-      directory.  For example, if you have the itcl3.2.1 distribution in
-      a directory named /usr/local/tcl/itcl3.2.1, then you should copy
-      the iwidgets file to this directory.
-
-      Note, if you don't copy the iwidgets archive to this directory,
-      then you will need to specify the --with-itcl flag when you run
-      the configure script.
-
-  2)  Untar/unzip the archive:
-
-	gunzip -c iwidgets4.0.1.tar.gz |tar xvf -
-
-  3)  Run the configuration script:
-
-        cd iwidgets4.0.0
-        ./configure
-
-      By default, the configuration script will set things up to be
-      installed in "/usr/local".  You can change this by specifying a
-      different "prefix" in the "configure" command.  You'll want to
-      use the same value you used for the prefix in the configuration
-      of your [incr Tcl/Tk] distribution.
-
-        ./configure --prefix=/your/install/path
-
-      The "configure" script generates a Makefile from the Makefile.in
-      template.
-
-      Also, as mentioned eariler, you may need to tell the [incr Widgets]
-      where the [incr Tcl] source is located.  For example, if your toplevel
-      [incr Tcl] directory is located in /opt/tools/tcl/itcl3.2.1 and you
-      are building the [incr Widgets] in a directory other than this, then
-      you will need to use the following:
-
-	./configure --prefix=/your/install/path \
-	  --with-itcl=/opt/tools/tcl/itcl3.2.1
-
-  4)  Run the test suite:
-
-        make test
-
-  7)  Install the [incr Widgets] man pages, demos, and script files.
-
-        make install
-
-
- Acknowledgements
-------------------------------------------------------------------------------
- Thanks to Brett Schwarz for a ton of work done on the new [incr Widgets]
- web site, http://incrtcl.sourceforge.net/iwidgets.
-
- Thanks to the original develment team, comprised of Mark Ulferts, Sue 
- Yockey, Bret Schuhmacher, Alfredo Jahn, John Sigler, and Bill Scott.  Also 
- thanks to Mark Harrison for his influence, confidence, and ideas.
-
- Thanks also to the new set of contributors which include John Tucker,
- Mitch Gorman, John Reekie, Alfredo Jahn, Ken Copeland, Tako Schotanus,
- Tony Parent and Michael McLennan
-
- Thanks to Michael McLennan, creator of [incr Tcl] and [incr Tk], for the 
- beta copies, training, assistance, and his infectious enthusiasm.
-
- Thanks to DSC Communications for picking up the copyright and supporting
- the public release of this software.
-
- Thanks to John P. Davis for creating the [incr Widgets] "Flaming Toaster"
- logo which can be seen at http://www.tcltk.com/iwidgets
-
- Thanks to WebNet Technologies for their assistance is designing the [incr
- Widgets] web site, as well as hosting it.
-
- Special thanks to my wife Karen for supporting this effort and to our two 
- girls, Katelyn and Bailey, who occasionally shared the PC with me.  Also
- thanks to my Discman and its relentless power supply as well as my rock
- and roll CD collection.  No music, no software.
-
---
- ____________________________________________________________________________
-    _/_/   _/_/    _/        _/    _/   Mark L. Ulferts
-   _/ _/ _/ _/    _/        _/    _/    ulferts@swbell.net
-  _/  _/_/ _/    _/        _/    _/     mulferts@austin.dsccc.com 
- _/   _/  _/ _/ _/_/_/ _/ _/_/_/_/ _/   DSC Communications Corp, Austin Texas
+iwidgets 4.1 -- iwidgets for itk4
+=================================
+
+Slightly modified iwidgets implementation for itk4.
+For changes see the iwidgets.patch file.
+
+Sources
+-------
+
+The itk repository is hosted at:
+  http://chiselapp.com/user/rene/repository/itk/
+A slightly modified iwidgets (see iwidgets.patch) is hosted at:
+  http://chiselapp.com/user/rene/repository/iwidgets/
+
+Ready to run binaries (*-itk) can be found at:
+  https://sourceforge.net/projects/kbskit/files/itk/
+
+To load itk call:
+  package require itk 4.0
+and to load itk and iwidgets call:
+  package require iwidgets 4.1
+
+Install
+-------
+
+Copy the library directory as iwidgets4.1 in your tcl library path.
+  cp -r library <your-install-path>/iwidgets4.1
+
+Documentation
+-------------
+
+Please refer to the original documantation at
+  http://incrtcl.sourceforge.net/iwidgets/
+
+License & support
+-----------------
+
+This work is under BSD license (see file 'license.terms')
+
+Acknowledgements
+----------------
+
+This work is based on the original "iwidgets" work at
+  http://incrtcl.sourceforge.net/iwidgets/
--- iwidgets4.0.1/license.terms	1998-07-27 11:50:16.000000000 -0700
+++ iwidgets4.1/license.terms	2012-09-28 07:05:34.000000000 -0700
@@ -1,3 +1,7 @@
+This software is copyrighted by Rene Zaumseil (the maintainer).
+The following terms apply to all files associated with the software
+unless explicitly disclaimed in individual files.
+
 This software is copyrighted by DSC Technologies and private individual 
 contributors.  The copyright holder is specifically listed in the header 
 of each file.  The following terms apply to all files associated with the
diff -Naur '--exclude=pkgIndex.tcl' iwidgets4.0.1/generic/calendar.itk iwidgets4.1/library/calendar.itk
--- iwidgets4.0.1/generic/calendar.itk	2002-09-05 12:33:06.000000000 -0700
+++ iwidgets4.1/library/calendar.itk	2012-09-28 07:05:35.000000000 -0700
@@ -20,7 +20,7 @@
 # mega-widget and the command and option interface was expanded to make 
 # it even more configurable, but the underlying logic is the same.
 #
-# @(#) $Id: calendar.itk,v 1.7 2002/09/05 19:33:06 smithc Exp $
+# @(#) $Id: calendar.itk,v 1.9 2007/05/24 22:41:02 hobbs Exp $
 # ----------------------------------------------------------------------
 #            Copyright (c) 1997 DSC Technologies Corporation
 # ======================================================================
@@ -614,11 +614,11 @@
     if {$date_ == $now_} {
 	$canvas_ itemconfigure $item \
 	    -font $itk_option(-currentdatefont) \
-	    -tags [list all-page date text now]
+	    -tags [list all-page date $date_-date text now]
     } else {
 	$canvas_ itemconfigure $item \
 	    -font $itk_option(-datefont) \
-	    -tags [list all-page date text]
+	    -tags [list all-page date $date_-date text]
     }
 }
 
@@ -789,6 +789,9 @@
 
         $itk_component(page) bind $date-sensor <ButtonPress-1> \
             [itcl::code $this _selectEvent $date]
+
+        $itk_component(page) bind $date-date <ButtonPress-1> \
+            [itcl::code $this _selectEvent $date]
     }
 
     #
@@ -859,10 +862,15 @@
     set month [clock format $time_ -format "%m"]
     set year  [clock format $time_ -format "%Y"]
 
-    foreach lastday {31 30 29 28} {
-        if {[catch {clock scan "$month/$lastday/$year"}] == 0} {
-            break
-        }
+    if {[info tclversion] >= 8.5} {
+	set startOfMonth [clock scan "$year-$month-01" -format %Y-%m-%d]
+	set lastday [clock format [clock add $startOfMonth 1 month -1 day] -format %d]
+    } else {
+	foreach lastday {31 30 29 28} {
+	    if {[catch {clock scan "$month/$lastday/$year"}] == 0} {
+		break
+	    }
+	}
     }
     set seconds [clock scan "$month/1/$year"]
     set firstday [_adjustday [clock format $seconds -format %w]]
diff -Naur '--exclude=pkgIndex.tcl' iwidgets4.0.1/generic/combobox.itk iwidgets4.1/library/combobox.itk
--- iwidgets4.0.1/generic/combobox.itk	2002-09-08 23:43:55.000000000 -0700
+++ iwidgets4.1/library/combobox.itk	2012-09-28 07:05:35.000000000 -0700
@@ -282,7 +282,7 @@
 	    }
 	}
 	0 - false - no - off {
-	    $itk_component(entry) configure -state disabled
+	    $itk_component(entry) configure -state readonly
 	}
 	default {
 	    error "bad editable option \"$itk_option(-editable)\":\
@@ -355,7 +355,7 @@
 		    $itk_component(entry) configure -state normal
 		}
 		0 - false - no - off {
-		    $itk_component(entry) configure -state disabled
+		    $itk_component(entry) configure -state readonly
 		}
 	    }
 	}
@@ -521,7 +521,8 @@
 	    } else {
 		if {$itk_option(-state) == "normal"} {
 		    eval iwidgets::Entryfield::insert $index $args
-		    [itcl::code $this _lookup ""]
+		    #RZ [itcl::code $this _lookup ""]
+		    eval [itcl::code $this _lookup ""]
 		}
 	    }
 	}
@@ -788,7 +789,7 @@
     set rtrn [delete $first $last]
     switch -- $itk_option(-editable) {
 	0 - false - no - off {
-	    $itk_component(entry) configure -state disabled
+	    $itk_component(entry) configure -state readonly
 	}
     }
     return $rtrn
@@ -1067,7 +1068,7 @@
     $itk_component(entry) insert 0 $item
     switch -- $itk_option(-editable) {
 	0 - false - no - off {
-	    $itk_component(entry) configure -state disabled
+	    $itk_component(entry) configure -state readonly
 	}
     }
 }
@@ -1134,7 +1135,7 @@
 	    $itk_component(entry) configure -state normal
 	}
 	0 - false - no - off {
-	    $itk_component(entry) configure -state disabled
+	    $itk_component(entry) configure -state readonly
 	}
     }
 
@@ -1441,3 +1442,5 @@
     set _inlookup 0
     return
 }
+
+ 	  	 
diff -Naur '--exclude=pkgIndex.tcl' iwidgets4.0.1/generic/dateentry.itk iwidgets4.1/library/dateentry.itk
--- iwidgets4.0.1/generic/dateentry.itk	2002-09-05 12:33:58.000000000 -0700
+++ iwidgets4.1/library/dateentry.itk	2012-09-28 07:05:35.000000000 -0700
@@ -8,7 +8,7 @@
 # ----------------------------------------------------------------------
 #   AUTHOR:  Mark L. Ulferts          E-mail: mulferts@austin.dsccc.com
 #
-#   @(#) $Id: dateentry.itk,v 1.6 2002/09/05 19:33:58 smithc Exp $
+#   @(#) $Id: dateentry.itk,v 1.7 2003/01/30 20:56:05 smithc Exp $
 # ----------------------------------------------------------------------
 #            Copyright (c) 1997 DSC Technologies Corporation
 # ======================================================================
@@ -203,6 +203,8 @@
 # image displayed in the icon button.
 # ------------------------------------------------------------------
 itcl::body iwidgets::Dateentry::_getDefaultIcon {} {
+#RZ
+    if {$_defaultIcon ne {}} {return $_defaultIcon}
     if {[lsearch [image types] pixmap] != -1} {
       set _defaultIcon [image create pixmap -data {
 	  /* XPM */
@@ -260,9 +262,9 @@
     # Since this image will only need to be created once, we redefine
     # this method to just return the image name for subsequent calls.
     #
-    itcl::body ::iwidgets::Dateentry::_getDefaultIcon {} {
-	return $_defaultIcon
-    }
+#RZ    itcl::body ::iwidgets::Dateentry::_getDefaultIcon {} {
+#RZ	return $_defaultIcon
+#RZ    }
 
     return $_defaultIcon
 }
@@ -364,9 +366,9 @@
     # Perform either a local or global grab based on the -grab option.
     #
     if {$itk_option(-grab) == "local"} {
-	grab $itk_component(popup)
+	::grab $itk_component(popup)
     } else {
-	grab -global $itk_component(popup)
+	::grab -global $itk_component(popup)
     }
 
     #
@@ -417,7 +419,7 @@
 # to the icon button that engages the popup action.
 # ------------------------------------------------------------------
 itcl::body iwidgets::Dateentry::_releaseGrab {} {
-    grab release $itk_component(popup)
+    ::grab release $itk_component(popup)
     $itk_component(iconbutton) configure -relief raised
     destroy $itk_component(popup) 
     bind $itk_component(iconbutton) <Button-1> [itcl::code $this _popup]
diff -Naur '--exclude=pkgIndex.tcl' iwidgets4.0.1/generic/datefield.itk iwidgets4.1/library/datefield.itk
--- iwidgets4.0.1/generic/datefield.itk	2002-02-24 20:45:02.000000000 -0800
+++ iwidgets4.1/library/datefield.itk	2012-09-28 07:05:35.000000000 -0700
@@ -6,7 +6,7 @@
 # ----------------------------------------------------------------------
 #   AUTHOR:  Mark L. Ulferts          E-mail: mulferts@austin.dsccc.com
 #
-#   @(#) $Id: datefield.itk,v 1.5 2002/02/25 04:45:02 mgbacke Exp $
+#   @(#) $Id: datefield.itk,v 1.6 2007/06/10 19:18:14 hobbs Exp $
 # ----------------------------------------------------------------------
 #            Copyright (c) 1997 DSC Technologies Corporation
 # ======================================================================
@@ -457,7 +457,7 @@
     # aren't attempting to insert more that 10 characters.  If
     # so ring the bell and break.
     #
-    if {[regexp {[0-9]} $char]} {
+    if {[string match {[0-9]} $char]} {
         if {[$itk_component(date) index insert] == 10} {
             bell
             return -code break
@@ -467,7 +467,7 @@
         # If we are currently in the month field then we process the
         # number entered based on the cursor position.  If we are at
         # at the first position and our iq is low, then accept any 
-        # input.  
+        # input.
         #
         if {$_cfield == "month"} {
 
@@ -475,7 +475,7 @@
                 if {$itk_option(-iq) == "low"} {
                 $itk_component(date) delete $month_start_pos
                 $itk_component(date) insert $month_start_pos $char
-            } else {            
+            } else {
                 #
                 # Otherwise, we're slightly smarter.  If the number
                 # is less than two insert it at position zero.  If 
@@ -497,7 +497,7 @@
                         $itk_component(date) delete $month_second_pos
                         $itk_component(date) insert $month_second_pos 1
                         $itk_component(date) icursor $month_second_pos
-                    }               
+                    }
 
                     #
                     # Finally, if the number is greater than one we'll 
@@ -838,8 +838,7 @@
         set day_pos 3
         set year_pos 8
     }
-        
-    
+
     switch $field {
         "month" {
             $itk_component(date) icursor $month_pos
diff -Naur '--exclude=pkgIndex.tcl' iwidgets4.0.1/generic/disjointlistbox.itk iwidgets4.1/library/disjointlistbox.itk
--- iwidgets4.0.1/generic/disjointlistbox.itk	2002-03-24 23:49:07.000000000 -0800
+++ iwidgets4.1/library/disjointlistbox.itk	2012-09-28 07:05:35.000000000 -0700
@@ -462,7 +462,11 @@
                 grid configure $itk_component(bbox) \
                         -in $itk_interior -row 0 -column 1 -columnspan 1 \
                                 -sticky nsew
-    
+
+		# Tk8.5: enforce compatibility to previous versions
+		# see Tk-ticket 2062394
+		catch {grid anchor $itk_component(bbox) center}
+
                 grid configure $itk_component(rhsbutton) \
                         -in $itk_component(bbox) -row 0 -column 0 -sticky ew
                 grid configure $itk_component(lhsbutton) \
diff -Naur '--exclude=pkgIndex.tcl' iwidgets4.0.1/generic/entryfield.itk iwidgets4.1/library/entryfield.itk
--- iwidgets4.0.1/generic/entryfield.itk	2001-09-17 12:24:46.000000000 -0700
+++ iwidgets4.1/library/entryfield.itk	2012-09-28 07:05:35.000000000 -0700
@@ -7,7 +7,7 @@
 #   AUTHOR:  Sue Yockey               E-mail: yockey@acm.org
 #            Mark L. Ulferts          E-mail: mulferts@austin.dsccc.com
 #
-#   @(#) $Id: entryfield.itk,v 1.6 2001/09/17 19:24:46 smithc Exp $
+#   @(#) $Id: entryfield.itk,v 1.7 2002/09/23 05:10:38 mgbacke Exp $
 # ----------------------------------------------------------------------
 #            Copyright (c) 1995 DSC Technologies Corporation
 # ======================================================================
@@ -102,7 +102,7 @@
     component hull configure -borderwidth 0
     
     itk_component add entry {
-	entry $itk_interior.entry
+	    entry $itk_interior.entry
     } {
 	keep -borderwidth -cursor -exportselection \
 		-foreground -highlightcolor \
@@ -120,7 +120,7 @@
     # Create the child site widget.
     #
     itk_component add -protected efchildsite {
-	frame $itk_interior.efchildsite
+	    frame $itk_interior.efchildsite
     } 
     set itk_interior $itk_component(efchildsite)
     
@@ -203,27 +203,27 @@
 # to enter into the entryfield.
 # ------------------------------------------------------------------
 itcl::configbody iwidgets::Entryfield::pasting {
-  set oldtags [bindtags $itk_component(entry)]
-  if {[lindex $oldtags 0] != "pastetag"} {
-    bindtags $itk_component(entry) [linsert $oldtags 0 pastetag] 
-  }
-
-  if ($itk_option(-pasting)) {
-    bind pastetag <ButtonRelease-2> [itcl::code $this _checkLength]
-    bind pastetag <Control-v> [itcl::code $this _checkLength]
-    bind pastetag <Insert> [itcl::code $this _checkLength]
-    bind pastetag <KeyPress> {}
-  } else {
-    bind pastetag <ButtonRelease-2> {break}
-    bind pastetag <Control-v> {break}
-    bind pastetag <Insert> {break}
-    bind pastetag <KeyPress> {
-      # Disable function keys > F9.
-      if {[regexp {^F[1,2][0-9]+$} "%K"]} {
-	break
-      }
+    set oldtags [bindtags $itk_component(entry)]
+    if {[lindex $oldtags 0] != "pastetag"} {
+        bindtags $itk_component(entry) [linsert $oldtags 0 pastetag] 
+    }
+
+    if {($itk_option(-pasting))} {
+        bind pastetag <ButtonRelease-2> [itcl::code $this _checkLength]
+        bind pastetag <Control-v> [itcl::code $this _checkLength]
+        bind pastetag <Insert> [itcl::code $this _checkLength]
+        bind pastetag <KeyPress> {}
+    } else {
+        bind pastetag <ButtonRelease-2> {break}
+        bind pastetag <Control-v> {break}
+        bind pastetag <Insert> {break}
+        bind pastetag <KeyPress> {
+            # Disable function keys > F9.
+            if {[regexp {^F[1,2][0-9]+$} "%K"]} {
+	            break
+            }
+        }
     }
-  }
 }
 
 # ------------------------------------------------------------------
@@ -494,15 +494,22 @@
     # A Return key invokes the optionally specified command option.
     #
     if {$sym == "Return"} {
-	uplevel #0 $itk_option(-command)
-	return -code break 1
+        if {$itk_option(-command) == ""} {
+            #
+            # Allow <Return> to propagate to parent if the -command option
+            # isn't defined.
+            #
+            return -code continue 1
+        }
+	    uplevel #0 $itk_option(-command)
+	    return -code break 1
     } 
     
     #
     # Tabs, BackSpace, and Delete are passed on for other bindings.
     #
     if {($sym == "Tab") || ($sym == "BackSpace") || ($sym == "Delete")} {
-	return -code continue 1
+	    return -code continue 1
     }
 
     # 
@@ -523,18 +530,18 @@
     set CTRL 4
     global tcl_platform
     if {$tcl_platform(platform) == "unix"} {
-      set ALT 8
+        set ALT 8
     } elseif {$tcl_platform(platform) == "windows"} {
-      set ALT 16
+        set ALT 16
     } else {
-      # This is something other than UNIX or WINDOWS.  Default to the
-      # old behavior (UNIX).
-      set ALT 8
+        # This is something other than UNIX or WINDOWS.  Default to the
+        # old behavior (UNIX).
+        set ALT 8
     }
     # Thanks to Rolf Schroedter for the following elegant conditional.  This
     # masks out all <Ctrl> and <Alt> key combinations.
     if {($char == "") || ($state & ($CTRL | $ALT))} {
-      return -code continue 1
+        return -code continue 1
     }
 
     #
@@ -543,10 +550,10 @@
     # invoke the invalid command procedure.
     #
     if {$itk_option(-fixed) != 0} {
-	if {[string length [get]] >= $itk_option(-fixed)} {
-	    uplevel #0 $itk_option(-invalid)
-	    return -code break 0
-	}
+	    if {[string length [get]] >= $itk_option(-fixed)} {
+	        uplevel #0 $itk_option(-invalid)
+	        return -code break 0
+	    }
     } 
     
     #
@@ -558,20 +565,20 @@
     # invalid procedure is called.
     #
     if {$itk_option(-validate) != {}} {
-	set cmd $itk_option(-validate)
+	    set cmd $itk_option(-validate)
 
-	regsub -all "%W" "$cmd" $itk_component(hull) cmd
-	regsub -all "%P" "$cmd" [list [_peek $char]] cmd
-	regsub -all "%S" "$cmd" [list [get]] cmd
-	regsub -all "%c" "$cmd" [list $char] cmd
+	    regsub -all "%W" "$cmd" $itk_component(hull) cmd
+	    regsub -all "%P" "$cmd" [list [_peek $char]] cmd
+	    regsub -all "%S" "$cmd" [list [get]] cmd
+	    regsub -all "%c" "$cmd" [list $char] cmd
         regsub -all {\\} "$cmd" {\\\\} cmd
 
-	set valid [uplevel #0 $cmd]
+	    set valid [uplevel #0 $cmd]
 	
-	if {($valid == "") || ([regexp 0|false|off|no $valid])} {
-	    uplevel #0 $itk_option(-invalid)
-	    return -code break 0
-	}
+	    if {($valid == "") || ([regexp 0|false|off|no $valid])} {
+	        uplevel #0 $itk_option(-invalid)
+	        return -code break 0
+	    }
     }
     
     return -code continue 1
@@ -586,18 +593,18 @@
 # specified by the -fixed option.
 # ------------------------------------------------------------------
 itcl::body iwidgets::Entryfield::_checkLength {} {
-  if {$itk_option(-fixed) != 0} {
-    if [catch {::selection get -selection CLIPBOARD} pending] {
-      # Nothing in the clipboard.  Check the primary selection.
-      if [catch {::selection get -selection PRIMARY} pending] {
-        # Nothing here either.  Goodbye.
-        return
-      }
-    }
-    set len [expr {[string length $pending] + [string length [get]]}]
-    if {$len > $itk_option(-fixed)} {
-      uplevel #0 $itk_option(-invalid)
-      return -code break 0
+    if {$itk_option(-fixed) != 0} {
+        if {[catch {::selection get -selection CLIPBOARD} pending]} {
+            # Nothing in the clipboard.  Check the primary selection.
+            if {[catch {::selection get -selection PRIMARY} pending]} {
+                # Nothing here either.  Goodbye.
+                return
+            }
+        }
+        set len [expr {[string length $pending] + [string length [get]]}]
+        if {$len > $itk_option(-fixed)} {
+            uplevel #0 $itk_option(-invalid)
+            return -code break 0
+        }
     }
-  }
 }
diff -Naur '--exclude=pkgIndex.tcl' iwidgets4.0.1/generic/extfileselectionbox.itk iwidgets4.1/library/extfileselectionbox.itk
--- iwidgets4.0.1/generic/extfileselectionbox.itk	2002-03-09 23:34:51.000000000 -0800
+++ iwidgets4.1/library/extfileselectionbox.itk	2012-09-28 07:05:35.000000000 -0700
@@ -11,7 +11,7 @@
 #  AUTHOR: Mark L. Ulferts               EMAIL: mulferts@spd.dsccc.com
 #          Anthony L. Parent                    tony.parent@symbios.com
 #
-#  @(#) $Id: extfileselectionbox.itk,v 1.5 2002/03/10 07:34:51 mgbacke Exp $
+#  @(#) $Id: extfileselectionbox.itk,v 1.6 2006/04/11 19:50:38 hobbs Exp $
 # ----------------------------------------------------------------------
 #            Copyright (c) 1997 DSC Technologies Corporation
 # ======================================================================
@@ -797,11 +797,11 @@
 itcl::body iwidgets::Extfileselectionbox::_setDirList {} {
     $itk_component(dirs) clear
 
+    set currentIndex ""
     if {$itk_option(-dirsearchcommand) == {}} {
         set cwd "$_pwd"
         
-        set counter      0
-        set currentIndex ""
+        set counter 0
         foreach i [lsort [glob -nocomplain \
                   [file join $cwd .*] [file join $cwd *]]] {
             if {[file isdirectory $i]} {
diff -Naur '--exclude=pkgIndex.tcl' iwidgets4.0.1/generic/labeledframe.itk iwidgets4.1/library/labeledframe.itk
--- iwidgets4.0.1/generic/labeledframe.itk	2001-08-15 11:32:51.000000000 -0700
+++ iwidgets4.1/library/labeledframe.itk	2012-09-28 07:05:34.000000000 -0700
@@ -155,7 +155,6 @@
 
   set tags [bindtags $itk_hull]
   bindtags $itk_hull [linsert $tags 0 itk-delete-$itk_hull]
-
   #
   # Create the childsite frame window
   # _______
@@ -211,7 +210,6 @@
   if {$_reposition != ""} {
     after cancel $_reposition
   }
-
   if {[winfo exists $itk_hull]} {
     set tags [bindtags $itk_hull]
     set i [lsearch $tags itk-delete-$itk_hull]
@@ -289,6 +287,7 @@
 #     {"-relx" "-rely" <rowconfigure|columnconfigure> <row/column number>}
 # -----------------------------------------------------------------------------
 itcl::body iwidgets::Labeledframe::_initTable {} {
+  if {![catch {set _LAYOUT_TABLE(nw-relx)}]} return ;#RZ
   array set _LAYOUT_TABLE {
     nw-relx 0.0  nw-rely 0.0  nw-wrap 0 nw-conf rowconfigure    nw-num 0
     n-relx  0.5  n-rely  0.0  n-wrap  0 n-conf  rowconfigure    n-num  0
@@ -313,7 +312,7 @@
   #
   # NOTE: Be careful to use the "body" command, or the proc will get lost!
   #
-  itcl::body ::iwidgets::Labeledframe::_initTable {} {}
+  #RZ itcl::body ::iwidgets::Labeledframe::_initTable {} {}
 }
 
 # -----------------------------------------------------------------------------
diff -Naur '--exclude=pkgIndex.tcl' iwidgets4.0.1/generic/menubar.itk iwidgets4.1/library/menubar.itk
--- iwidgets4.0.1/generic/menubar.itk	2001-08-15 11:33:13.000000000 -0700
+++ iwidgets4.1/library/menubar.itk	2012-09-28 07:05:34.000000000 -0700
@@ -160,6 +160,7 @@
 
 	variable _menuOption          ;# The -menu option
 	variable _helpString          ;# The -helpstr optio
+	variable _fixed 0 ;#RZ bug fix
     }
 }
 
@@ -198,7 +199,7 @@
     set _pathMap(.) $itk_component(menubar)
 
     eval itk_initialize $args
-
+    set _fixed 1 ;#RZ
     #
     # HACK HACK HACK
     # Tk expects some variables to be defined and due to some
@@ -357,7 +358,8 @@
 
 	# IF one exists already, delete the old one and create
 	# a new one
-	if { ! [catch {_parsePath .0}] } {
+	#RZ if { ! [catch {_parsePath .0}] } 
+	if { $_fixed && ! [catch {_parsePath .0}] } {
 	    delete .0 .last
 	} 
 
@@ -2071,9 +2073,7 @@
 
     set concatPath ""
     foreach seg $segments {
-
 	set concatPath [_getSymbolicPath $concatPath $seg]
-
 	if { [catch {set _pathMap($concatPath)} ] } {
 	    error "bad path: \"$path\" does not exist. \"$seg\" not valid"
 	}
diff -Naur '--exclude=pkgIndex.tcl' iwidgets4.0.1/generic/pushbutton.itk iwidgets4.1/library/pushbutton.itk
--- iwidgets4.0.1/generic/pushbutton.itk	2001-08-17 12:03:44.000000000 -0700
+++ iwidgets4.1/library/pushbutton.itk	2012-09-28 07:05:34.000000000 -0700
@@ -11,7 +11,7 @@
 #   AUTHOR:  Mark L. Ulferts        EMAIL: mulferts@austin.dsccc.com
 #            Bret A. Schuhmacher    EMAIL: bas@wn.com
 #
-#   @(#) $Id: pushbutton.itk,v 1.3 2001/08/17 19:03:44 smithc Exp $
+#   @(#) $Id: pushbutton.itk,v 1.4 2007/06/10 19:28:30 hobbs Exp $
 # ----------------------------------------------------------------------
 #            Copyright (c) 1995 DSC Technologies Corporation
 # ======================================================================
@@ -100,19 +100,24 @@
     itk_option add hull.borderwidth hull.relief
     itk_option add hull.highlightcolor
     itk_option add hull.highlightbackground
-    
-    component hull configure \
+
+    if {$::tk_version > 8.3} {
+	# Tk 8.4+ frame -padx -pady options creates inadvertant margin box
+	component hull configure -padx 0 -pady 0 \
 	    -borderwidth [$this cget -borderwidth]
-    
+    } else {
+	component hull configure -borderwidth [$this cget -borderwidth]
+    }
+
     pack propagate $itk_component(hull) no
 
     itk_component add pushbutton {
 	button $itk_component(hull).pushbutton \
     } {
         usual
-	keep -underline -wraplength -state -command 
+	keep -underline -wraplength -state -command
     }
-    pack $itk_component(pushbutton) -expand 1 -fill both 
+    pack $itk_component(pushbutton) -expand 1 -fill both
     
     #
     # Initialize the widget based on the command line options.
diff -Naur '--exclude=pkgIndex.tcl' iwidgets4.0.1/generic/scrolledhtml.itk iwidgets4.1/library/scrolledhtml.itk
--- iwidgets4.0.1/generic/scrolledhtml.itk	2002-02-15 21:11:08.000000000 -0800
+++ iwidgets4.1/library/scrolledhtml.itk	2012-09-28 07:05:34.000000000 -0700
@@ -42,7 +42,7 @@
 # ----------------------------------------------------------------------
 #  AUTHOR: Kris Raney                    EMAIL: kraney@spd.dsccc.com
 #
-#  @(#) $Id: scrolledhtml.itk,v 1.7 2002/02/16 05:11:08 mgbacke Exp $
+#  @(#) $Id: scrolledhtml.itk,v 1.8 2004/12/02 17:49:18 davygrvy Exp $
 # ----------------------------------------------------------------------
 #            Copyright (c) 1996 DSC Technologies Corporation
 # ======================================================================
@@ -139,7 +139,7 @@
   itk_option define -alink alink ALink red
   itk_option define -linkhighlight alink ALink red
   itk_option define -unknownimage unknownimage File {}
-  itk_option define -textbackground textBackground Background {}
+  itk_option define -textbackground textBackground Background {#ffffff};#RZ
   itk_option define -update update Update 1
   itk_option define -debug debug Debug 0
 
@@ -352,7 +352,8 @@
     foreach x $_images {
       ::image delete $x
     }
-    if {$_unknownimg != $_defUnknownImg} {
+    #RZ if {$_unknownimg != $_defUnknownImg}
+    if {$_unknownimg != "" && $_unknownimg != $_defUnknownImg} {
       ::image delete $_unknownimg
     }
 }
@@ -1418,7 +1419,7 @@
       if {![regexp {^[+-].*} $ar(size)]} {
          set _pointsndx $ar(size)
       } else {
-        set _pointsndx [expr {$_basefontsize $ar(size)}]
+        set _pointsndx [expr $_basefontsize $ar(size)]
       }
       if { $_pointsndx > 6 } {
        set _pointsndx 6
diff -Naur '--exclude=pkgIndex.tcl' iwidgets4.0.1/generic/shell.itk iwidgets4.1/library/shell.itk
--- iwidgets4.0.1/generic/shell.itk	2002-02-24 22:43:26.000000000 -0800
+++ iwidgets4.1/library/shell.itk	2012-09-28 07:05:35.000000000 -0700
@@ -8,7 +8,7 @@
 #  AUTHOR: Mark L. Ulferts              EMAIL: mulferts@austin.dsccc.com
 #          Kris Raney                   EMAIL: kraney@spd.dsccc.com
 #
-#  @(#) $Id: shell.itk,v 1.7 2002/02/25 06:43:26 mgbacke Exp $
+#  @(#) $Id: shell.itk,v 1.9 2007/06/10 19:35:04 hobbs Exp $
 # ----------------------------------------------------------------------
 #            Copyright (c) 1996 DSC Technologies Corporation
 # ======================================================================
@@ -60,7 +60,8 @@
     public method deactivate {args}
     public method center {{widget {}}}
  
-    private variable _result {}     ;# Resultant value for modal activation.
+    protected variable _result {}     ;# Resultant value for modal activation.
+
     private variable _busied {}     ;# List of busied top level widgets.
 
     common grabstack {}
@@ -243,6 +244,17 @@
     raise $itk_component(hull)
     wm deiconify $itk_component(hull)
     tkwait visibility $itk_component(hull)
+    # For some mysterious reason, Tk sometimes returns too late from the
+    # "tkwait visibility", i.e. after the "deactivate" method was invoked,
+    # i.e. after the dialog window already disappeared. This would lead to
+    # an infinite vwait on _wait($this) further on. Trap this case.
+    # See also 2002-03-15 message to the Tcl/Tk newsgroup.
+    # Remark that tests show that if "raise" is given *after* "deiconify" 
+    # (see above), "tkwait visibility" always returns duly on time.....
+    if {![winfo ismapped $itk_component(hull)]} {
+	# means "deactivate" went already through the grab-release stuff.
+	return $_result
+    }
 
     # Need to flush the event loop.  This line added as a result of
     # SF ticket #227885.
diff -Naur '--exclude=pkgIndex.tcl' iwidgets4.0.1/generic/timeentry.itk iwidgets4.1/library/timeentry.itk
--- iwidgets4.0.1/generic/timeentry.itk	2001-08-17 12:05:08.000000000 -0700
+++ iwidgets4.1/library/timeentry.itk	2012-09-28 07:05:34.000000000 -0700
@@ -192,7 +192,8 @@
 # image displayed in the icon button.
 # ------------------------------------------------------------------
 itcl::body iwidgets::Timeentry::_getDefaultIcon {} {
-
+#RZ
+  if {$_defaultIcon ne {}} {return $_defaultIcon}
   if {[lsearch [image types] pixmap] != -1} {
 	set _defaultIcon [image create pixmap -data {
 		    /* XPM */
@@ -249,9 +250,9 @@
     # Since this image will only need to be created once, we redefine
     # this method to just return the image name for subsequent calls.
     #
-    itcl::body ::iwidgets::Timeentry::_getDefaultIcon {} {
-	return $_defaultIcon
-    }
+#RZ    itcl::body ::iwidgets::Timeentry::_getDefaultIcon {} {
+#RZ	return $_defaultIcon
+#RZ    }
 
     return $_defaultIcon
 }
diff -Naur '--exclude=pkgIndex.tcl' iwidgets4.0.1/generic/toolbar.itk iwidgets4.1/library/toolbar.itk
--- iwidgets4.0.1/generic/toolbar.itk	2001-08-17 12:05:54.000000000 -0700
+++ iwidgets4.1/library/toolbar.itk	2012-09-28 07:05:35.000000000 -0700
@@ -684,7 +684,8 @@
     foreach optionSet [$itk_component($name) configure] {
 	set option [lindex $optionSet 0]
 	if { [lsearch $_optionList $option] != -1 } {
-	    itk_option add $name.$option
+	    #RZ itk_option add $name.$option
+	    itk_option add $name.[string range $option 1 end]
 	}
     }
     
diff -Naur iwidgets4.0.1/tests/all.tcl iwidgets4.1/tests/all.tcl
--- iwidgets4.0.1/tests/all.tcl	2000-07-05 23:43:38.000000000 -0700
+++ iwidgets4.1/tests/all.tcl	2012-09-28 07:05:35.000000000 -0700
@@ -80,6 +80,7 @@
 	# Print results to ::tcltest::outputChannel.
 	puts $::tcltest::outputChannel $msg
     }
+}
 
     # Now concatenate the temporary log file to
     # ::tcltest::outputChannel 
@@ -105,8 +106,6 @@
     } msg]} {
 	puts $::tcltest::outputChannel $msg
     }
-}
-
 set numFailures [llength $::tcltest::failFiles]
 
 # cleanup
