Index: branches/blt4/gui/scripts/Makefile.in
===================================================================
--- branches/blt4/gui/scripts/Makefile.in	(revision 1883)
+++ branches/blt4/gui/scripts/Makefile.in	(revision 1897)
@@ -14,6 +14,5 @@
 INSTALL		= @INSTALL@
 MKDIR_P		= @MKDIR_P@
-TCL_VERSION	= @TCL_VERSION@
-TCLSH		= $(bindir)/tclsh$(TCL_VERSION)
+TCLSH		= @TCLSH@
 VPATH		= $(srcdir)
 PACKAGE_VERSION = @PACKAGE_VERSION@
@@ -115,4 +114,5 @@
 		$(srcdir)/utils.tcl \
 		$(srcdir)/valueresult.tcl \
+		$(srcdir)/videoviewer.tcl \
 		$(srcdir)/visviewer.tcl \
 		$(srcdir)/vtkviewer.tcl \
Index: branches/blt4/gui/scripts/analyzer.tcl
===================================================================
--- branches/blt4/gui/scripts/analyzer.tcl	(revision 1883)
+++ branches/blt4/gui/scripts/analyzer.tcl	(revision 1897)
@@ -433,16 +433,18 @@
 
     if {$status != 0} {
-	$itk_component(runinfo) configure -state normal
-	$itk_component(runinfo) delete 1.0 end
-	$itk_component(runinfo) insert end "Problem launching job:\n\n" text
-	_simOutput $result
-	$itk_component(runinfo) configure -state disabled
-	$itk_component(runinfo) see 1.0
-
-	# Try to create a support ticket for this error.
-	# It may be a real problem.
-	if {[Rappture::bugreport::shouldReport for jobs]} {
-	    Rappture::bugreport::register "Problem launching job:\n\n$result\n== RAPPTURE INPUT ==\n[$_tool xml xml]"
-	}
+        $itk_component(runinfo) configure -state normal
+        $itk_component(runinfo) delete 1.0 end
+        $itk_component(runinfo) insert end "Problem launching job:\n\n" text
+        _simOutput $result
+        $itk_component(runinfo) configure -state disabled
+        $itk_component(runinfo) see 1.0
+
+        # Try to create a support ticket for this error.
+        # It may be a real problem.
+        if {[Rappture::bugreport::shouldReport for jobs]} {
+            set ::errorInfo "== RAPPTURE INPUT ==\n[$_tool xml xml]"
+            Rappture::bugreport::register "Problem launching job:\n$result"
+            Rappture::bugreport::send
+        }
     } else {
 	$itk_component(notebook) current analyze
Index: branches/blt4/gui/scripts/balloon.tcl
===================================================================
--- branches/blt4/gui/scripts/balloon.tcl	(revision 1883)
+++ branches/blt4/gui/scripts/balloon.tcl	(revision 1897)
@@ -217,11 +217,4 @@
 	# window). So for now, better to place the balloon window somewhere
 	# than to fail with a bad geometry.
-	#
-	# Update: This answer could be that the root window (deskop) is 
-	#	  resized but XHeightOfScreen XWidthOfScreen still 
-	#	  report the initial size.
-	#
-	#	  Fixed in new BLT.
-	#
 	wm geometry $p +$px+$py
     } else {
Index: branches/blt4/gui/scripts/bugreport.tcl
===================================================================
--- branches/blt4/gui/scripts/bugreport.tcl	(revision 1883)
+++ branches/blt4/gui/scripts/bugreport.tcl	(revision 1897)
@@ -11,19 +11,21 @@
 #  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 # ======================================================================
+option add *BugReport*Label.font {Helvetica -12} startupFile
 option add *BugReport*banner*foreground white startupFile
 option add *BugReport*banner*background #a9a9a9 startupFile
 option add *BugReport*banner*highlightBackground #a9a9a9 startupFile
-option add *BugReport*banner*font \
-    -*-helvetica-bold-r-normal-*-18-* startupFile
-option add *BugReport*Label.font \
-    -*-helvetica-medium-r-normal-*-12-* startupFile
+option add *BugReport*banner.title.font {Helvetica -18 bold} startupFile
 option add *BugReport*xmit*wrapLength 3i startupFile
 option add *BugReport*expl.width 50 startupFile
-option add *BugReport*expl.font \
-    -*-helvetica-medium-r-normal-*-12-* startupFile
-option add *BugReport*expl.boldFont \
-    -*-helvetica-bold-r-normal-*-12-* startupFile
+option add *BugReport*expl.font {Helvetica -12} startupFile
+option add *BugReport*expl.boldFont {Helvetica -12 bold} startupFile
+option add *BugReport*comments.l.font {Helvetica -12 italic} startupFile
+option add *BugReport*comments.info.text.font {Helvetica -12} startupFile
+option add *BugReport*details*font {Courier -12} startupFile
 
 namespace eval Rappture::bugreport {
+    # details from the current trouble report
+    variable details
+
     # assume that if there's a problem launching a job, we should know it
     variable reportJobFailures 1
@@ -50,41 +52,71 @@
 proc Rappture::bugreport::activate {err} {
     global env errorInfo
+    variable details
 
     if {"@SHOWDETAILS" == $err} {
+        pack propagate .bugreport yes
+	pack forget .bugreport.expl
 	pack forget .bugreport.xmit
-	pack forget .bugreport.ok
+	pack forget .bugreport.done
+        pack forget .bugreport.cntls.show
+	pack .bugreport.cntls -after .bugreport.banner -side bottom -fill x
 	pack .bugreport.details -after .bugreport.banner \
 	    -expand yes -fill both -padx 8 -pady 8
-	focus .bugreport.details.cntls.ok
+	pack .bugreport.comments -after .bugreport.details \
+	    -expand yes -fill both -padx 8 -pady {0 8}
 	return
     }
 
-    # always fill in details so we can submit trouble reports later
+    # gather details so we can submit trouble reports later
+    # do this now, before we do anything with "catch" down below
+    # that might mask the errorInfo
+    register $err
+
+    pack propagate .bugreport yes
+    pack forget .bugreport.details
+    pack forget .bugreport.xmit
+    pack forget .bugreport.done
+    pack .bugreport.cntls.show -side right
+    pack .bugreport.cntls -after .bugreport.banner -side bottom -fill x
+    pack .bugreport.expl -after .bugreport.banner \
+        -expand yes -fill both -padx 8 -pady 8
+    pack .bugreport.comments -after .bugreport.expl \
+        -expand yes -fill both -padx 8 -pady {0 8}
+
+    .bugreport.expl configure -state normal
+    .bugreport.expl delete 1.0 end
+
+    set url [Rappture::Tool::resources -huburl]
+    if {"" != $url} {
+        .bugreport.expl insert end "Something went wrong with this tool.  Help us understand what happened by submitting a trouble report, so we can fix the problem.  If you continue having trouble with this tool, please close it and restart."
+        .bugreport.cntls.send configure -state normal
+	focus .bugreport.cntls.send
+    } else {
+        .bugreport.expl insert end "Something went wrong with this tool.  We would ask you to submit a trouble report about the error, but we can't tell what hub it should be submitted to.  If you continue having trouble with this tool, please close it and restart."
+        pack forget .bugreport.comments
+        .bugreport.cntls.send configure -state disabled
+	focus .bugreport.cntls.ok
+    }
+    fixTextHeight .bugreport.expl
+    .bugreport.expl configure -state disabled
+
     .bugreport.details.info.text configure -state normal
     .bugreport.details.info.text delete 1.0 end
-    .bugreport.details.info.text insert end "$err\n-----\n$errorInfo"
+    .bugreport.details.info.text insert end "    USER: $details(login)\n"
+    .bugreport.details.info.text insert end "HOSTNAME: $details(hostname)\n"
+    .bugreport.details.info.text insert end "    TOOL: $details(referrer)\n"
+    .bugreport.details.info.text insert end " SESSION: $details(session)\n"
+    .bugreport.details.info.text insert end "CATEGORY: $details(category)\n"
+    .bugreport.details.info.text insert end " SUMMARY: $details(summary)\n"
+    .bugreport.details.info.text insert end "---------\n"
+    .bugreport.details.info.text insert end $details(stackTrace)
     .bugreport.details.info.text configure -state disabled
-
-    if {[shouldReport for oops]} {
-	pack forget .bugreport.details
-	pack forget .bugreport.expl
-	pack .bugreport.ok -side bottom -after .bugreport.banner -pady {0 8}
-	pack .bugreport.xmit -after .bugreport.ok -padx 8 -pady 8
-	focus .bugreport.ok
-	set dosubmit 1
-    } else {
-	pack forget .bugreport.expl
-	pack forget .bugreport.xmit
-	pack forget .bugreport.ok
-	pack .bugreport.details -after .bugreport.banner \
-	    -expand yes -fill both -padx 8 -pady 8
-	focus .bugreport.details.cntls.ok
-	set dosubmit 0
-    }
 
     set w [winfo reqwidth .bugreport]
     set h [winfo reqheight .bugreport]
     set x [expr {([winfo screenwidth .bugreport]-$w)/2}]
-    set y [expr {([winfo screenheight .bugreport]-$w)/2}]
+    if {$x < 0} {set x 0}
+    set y [expr {([winfo screenheight .bugreport]-$h)/2}]
+    if {$y < 0} {set y 0}
 
     wm geometry .bugreport +$x+$y
@@ -94,8 +126,4 @@
     catch {grab set .bugreport}
     update
-
-    if {$dosubmit} {
-	submit
-    }
 }
 
@@ -123,17 +151,20 @@
     set info [.bugreport.details.info.text get 1.0 end]
 
+    pack propagate .bugreport no
     pack forget .bugreport.details
-    pack .bugreport.ok -side bottom -after .bugreport.banner -pady {0 8}
-    pack .bugreport.xmit -after .bugreport.ok -padx 8 -pady 8
+    pack forget .bugreport.expl
+    pack forget .bugreport.comments
+    pack forget .bugreport.cntls
+    pack .bugreport.xmit -after .bugreport.banner -padx 8 -pady 8
     .bugreport.xmit.title configure -text "Sending trouble report to [Rappture::Tool::resources -hubname]..."
-    focus .bugreport.ok
 
     # send off the trouble report...
     .bugreport.xmit.icon start
-    set status [catch {register $info} result]
+    set status [catch send result]
     .bugreport.xmit.icon stop
 
+    pack propagate .bugreport yes
     pack forget .bugreport.xmit
-    pack .bugreport.expl -after .bugreport.ok -padx 8 -pady 8
+    pack .bugreport.expl -after .bugreport.banner -padx 8 -pady 8
     .bugreport.expl configure -state normal
     .bugreport.expl delete 1.0 end
@@ -146,52 +177,37 @@
 	.bugreport.details.info.text configure -state disabled
 
-	.bugreport.expl insert end "This tool encountered an unexpected error.  We tried to submit a trouble report automatically, but that failed.  If you want to report this incident, you can file your own trouble report.  Look for the \"Help\" or \"Support\" links on the main navigation bar of the web site.\n\nIf you continue having trouble with this tool, please close it and launch another session."
+	.bugreport.expl insert end "Oops! Ticket submission failed:\n$result\n\nIf you want to report the original problem, you can file your own trouble report by going to the web site and clicking on the \"Help\" or \"Support\" link on the main navigation bar.  If you continue having trouble with this tool, please close it and restart."
     } elseif {[regexp {Ticket #([0-9]*) +\((.*?)\) +([0-9]+) +times} $result match ticket extra times]} {
-	.bugreport.expl insert end "This tool encountered an unexpected error.  The problem has been reported as " "" "Ticket #$ticket" bold " in our system." ""
+	.bugreport.expl insert end "This problem has been reported as " "" "Ticket #$ticket" bold " in our system." ""
 	if {[string is integer $times] && $times > 1} {
 	    .bugreport.expl insert end "  This particular problem has been reported $times times."
 	}
-	.bugreport.expl insert end "\n\nIf you continue having trouble with this tool, please close it and launch another session."
+	.bugreport.expl insert end "\n\nIf you continue having trouble with this tool, please close it and restart.  Thanks for reporting the problem and helping us improve things!"
     } else {
-	.bugreport.expl insert end "This tool encountered an unexpected error, and the problem was reported.  Here is the response from the hub, which may contain information about your ticket:\n" "" $result bold "\n\nIf you continue having trouble with this tool, please close it and launch another session." ""
-    }
-    for {set h 1} {$h < 50} {incr h} {
-	.bugreport.expl configure -height $h
-	.bugreport.expl see 1.0
-	update idletasks
-	if {"" != [.bugreport.expl bbox end-1char]} {
-	    break
-	}
-    }
+	.bugreport.expl insert end "This problem has been reported.  Here is the response from the hub, which may contain information about your ticket:\n" "" $result bold "\n\nIf you continue having trouble with this tool, please close it and restart.  Thanks for reporting the problem and helping us improve things!" ""
+    }
+    fixTextHeight .bugreport.expl
     .bugreport.expl configure -state disabled
-}
-
-# ----------------------------------------------------------------------
-# USAGE: download
-#
-# Used to download the current ticket information to the user's
-# desktop.
-# ----------------------------------------------------------------------
-proc Rappture::bugreport::download {} {
-    set info [.bugreport.details.info.text get 1.0 end]
-    Rappture::filexfer::download $info bugreport.txt
-}
-
-# ----------------------------------------------------------------------
-# USAGE: register <stackTrace>
-#
-# Low-level function used to send bug reports back to the hub site.
-# Error details in the <stackTrace> are posted to a URL that creates
-# a support ticket.  Returns a string of the following form,
-# representing details about the new or existing ticket:
-#   Ticket #XX (XXXXXX) XX times
-# ----------------------------------------------------------------------
-proc Rappture::bugreport::register {stackTrace} {
-    global env tcl_platform
-
-    package require http
-    package require tls
-    http::register https 443 ::tls::socket
-
+    pack .bugreport.done -side bottom -padx 8 -pady 8
+    focus .bugreport.done
+}
+
+# ----------------------------------------------------------------------
+# USAGE: register <err>
+#
+# Low-level function used to capture information about a bug report
+# prior to calling "send", which actually sends the ticket.  We usually
+# let the user preview the information and decide whether or not to
+# send the ticket.
+# ----------------------------------------------------------------------
+proc Rappture::bugreport::register {err} {
+    global errorInfo tcl_platform
+    variable details
+
+    #
+    # Figure out exactly what we'll send if the bug report is
+    # submitted, so we can show the user.
+    #
+    set stackTrace "$err\n---------\n$errorInfo"
     if {![regexp {^([^\n]+)\n} $stackTrace match summary]} {
 	if {[string length $stackTrace] == 0} {
@@ -246,15 +262,46 @@
     }
 
+    set details(summary) $summary
+    set details(category) $category
+    set details(stackTrace) $stackTrace
+    set details(login) $tcl_platform(user)
+    set details(hostname) [info hostname]
+    set details(session) [Rappture::Tool::resources -session]
+    set details(referrer) "tool \"[Rappture::Tool::resources -appname]\""
+}
+
+# ----------------------------------------------------------------------
+# USAGE: send
+#
+# Low-level function used to send bug reports back to the hub site.
+# Error details gathered by a previous call to "register" are sent
+# along as a support ticket.  Returns a string of the following form,
+# representing details about the new or existing ticket:
+#   Ticket #XX (XXXXXX) XX times
+# ----------------------------------------------------------------------
+proc Rappture::bugreport::send {} {
+    variable details
+
+    package require http
+    package require tls
+    http::register https 443 ::tls::socket
+
+    set report $details(stackTrace)
+    set cmts [string trim [.bugreport.comments.info.text get 1.0 end]]
+    if {[string length $cmts] > 0} {
+        set report "$cmts\n[string repeat = 72]\n$report"
+    }
+
     set query [http::formatQuery \
 	option com_support \
 	task create \
 	no_html 1 \
-	report $stackTrace \
-	login $tcl_platform(user) \
-	sesstoken [Rappture::Tool::resources -session] \
-	hostname [info hostname] \
-	category $category \
-	summary $summary \
-	referrer "tool \"[Rappture::Tool::resources -appname]\"" \
+	report $report \
+	login $details(login) \
+	sesstoken $details(session) \
+	hostname $details(hostname) \
+	category $details(category) \
+	summary $details(summary) \
+	referrer $details(referrer) \
     ]
     
@@ -282,4 +329,30 @@
 
 # ----------------------------------------------------------------------
+# USAGE: fixTextHeight <widget>
+#
+# Used internally to adjust the height of a text widget so it is just
+# tall enough to show the info within it.
+# ----------------------------------------------------------------------
+proc Rappture::bugreport::fixTextHeight {widget} {
+    #
+    # HACK ALERT!  In Tk8.5, we can count display lines directly.
+    #   But for earlier versions, we have to cook up something
+    #   similar.
+    #
+    if {[catch {$widget count -displaylines 1.0 end} h] == 0 && $h > 0} {
+        $widget configure -height $h
+    } else {
+        for {set h 1} {$h < 15} {incr h} {
+	    $widget configure -height $h
+	    $widget see 1.0
+	    update idletasks
+	    if {"" != [$widget bbox end-1char]} {
+	        break
+	    }
+        }
+    }
+}
+
+# ----------------------------------------------------------------------
 # USAGE: shouldReport jobfailures <boolean>
 # USAGE: shouldReport for ?oops|jobs?
@@ -304,10 +377,4 @@
 	}
 	for {
-	    # is this a tool in production?
-	    if {![info exists env(RAPPTURE_VERSION)]
-		  || $env(RAPPTURE_VERSION) != "current"} {
-		return 0
-	    }
-
 	    # is it being run within a workspace?
 	    set appname [Rappture::Tool::resources -appname]
@@ -343,5 +410,5 @@
 label .bugreport.banner.icon -image [Rappture::icon alert]
 pack .bugreport.banner.icon -side left -padx 2 -pady 2
-label .bugreport.banner.title -text "Oops! Unexpected Error"
+label .bugreport.banner.title -text "Oops! Internal Error"
 pack .bugreport.banner.title -side left -padx {0 8} -pady 2
 
@@ -352,6 +419,47 @@
     Rappture::bugreport::deactivate
 
-button .bugreport.ok -text "Dismiss" -command Rappture::bugreport::deactivate
-pack .bugreport.ok -side bottom -pady {0 8}
+set bg [.bugreport cget -background]
+text .bugreport.expl -borderwidth 0 -highlightthickness 0 -background $bg \
+    -height 3 -wrap word
+.bugreport.expl tag configure bold \
+    -font [option get .bugreport.expl boldFont Font]
+#
+# HACK ALERT!  We have problems with fixTextHeight working correctly
+#   on Windows for Tk8.4 and earlier.  To make it work properly, we
+#   add the binding below.  At some point, we'll ditch 8.4 and we can
+#   use the new "count -displaylines" option in Tk8.5.
+#
+bind .bugreport.expl <Map> {Rappture::bugreport::fixTextHeight %W}
+
+frame .bugreport.comments
+label .bugreport.comments.l -text "What were you doing just before this error?" -anchor w
+pack .bugreport.comments.l -side top -anchor w
+Rappture::Scroller .bugreport.comments.info -xscrollmode none -yscrollmode auto
+text .bugreport.comments.info.text -width 30 -height 3 -wrap word
+.bugreport.comments.info contents .bugreport.comments.info.text
+bind .bugreport.comments.info.text <ButtonPress> {focus %W}
+pack .bugreport.comments.info -expand yes -fill both
+
+frame .bugreport.cntls
+pack .bugreport.cntls -side bottom -fill x
+button .bugreport.cntls.ok -text "Ignore" -command {
+    Rappture::bugreport::deactivate
+}
+pack .bugreport.cntls.ok -side left -padx {4 20} -pady 8
+button .bugreport.cntls.send -text "Send Trouble Report" -command {
+    Rappture::bugreport::submit
+}
+pack .bugreport.cntls.send -side right -padx 4 -pady 8
+
+button .bugreport.cntls.show -text "Show Details..." \
+    -command {Rappture::bugreport::activate @SHOWDETAILS}
+pack .bugreport.cntls.show -side right
+
+
+frame .bugreport.details
+Rappture::Scroller .bugreport.details.info -xscrollmode auto -yscrollmode auto
+text .bugreport.details.info.text -width 50 -height 15 -wrap none
+.bugreport.details.info contents .bugreport.details.info.text
+pack .bugreport.details.info -expand yes -fill both
 
 frame .bugreport.xmit
@@ -364,39 +472,6 @@
 pack .bugreport.xmit.title -side left -expand yes -fill x
 
-text .bugreport.expl -borderwidth 0 -highlightthickness 0 -wrap word
-.bugreport.expl tag configure bold \
-    -font [option get .bugreport.expl boldFont Font]
-
-bind .bugreport.expl <Control-1><Control-1><Control-3><Control-3> {
-    Rappture::bugreport::activate @SHOWDETAILS
-}
-
-bind .bugreport.expl <Control-1><Control-1><Control-Shift-1><Control-Shift-1> {
-    Rappture::bugreport::activate @SHOWDETAILS
-}
-
-frame .bugreport.details
-frame .bugreport.details.cntls
-pack .bugreport.details.cntls -side bottom -fill x
-button .bugreport.details.cntls.ok -text "Dismiss" -command {
-    Rappture::bugreport::deactivate
-}
-pack .bugreport.details.cntls.ok -side right -padx 2 -pady 4
-button .bugreport.details.cntls.send -text "Send Trouble Report" -command {
-    Rappture::bugreport::submit
-}
-pack .bugreport.details.cntls.send -side left -padx 2 -pady 4
-button .bugreport.details.cntls.dload -text "Download" -command {
-    Rappture::bugreport::download
-}
-pack .bugreport.details.cntls.dload -side left -padx 2 -pady 4
-
-set scrollset .bugreport.details.info
-blt::scrollset $scrollset -xscrollbar $scrollset.xs -yscrollbar $scrollset.ys \
-    -window $scrollset.text
-blt::tk::scrollbar $scrollset.xs
-blt::tk::scrollbar $scrollset.ys
-text .bugreport.details.info.text -width 50 -height 15 -wrap none
-pack .bugreport.details.info -expand yes -fill both
+button .bugreport.done -text "Done" \
+    -command Rappture::bugreport::deactivate
 
 # this binding keeps the bugreport window on top
Index: branches/blt4/gui/scripts/combobox.tcl
===================================================================
--- branches/blt4/gui/scripts/combobox.tcl	(revision 1883)
+++ branches/blt4/gui/scripts/combobox.tcl	(revision 1897)
@@ -134,6 +134,6 @@
 	    $itk_component(entry) configure -state disabled
 	}
-	set cmd [list event generate $itk_component(hull) <<Value>>]
-	after 10 [list catch $cmd]
+
+	after 10 [list catch [list event generate $itk_component(hull) <<Value>>]]
     } elseif {[llength $args] != 0} {
 	error "wrong # args: should be \"value ?newval?\""
Index: branches/blt4/gui/scripts/filexfer.tcl
===================================================================
--- branches/blt4/gui/scripts/filexfer.tcl	(revision 1883)
+++ branches/blt4/gui/scripts/filexfer.tcl	(revision 1897)
@@ -338,4 +338,5 @@
               /apps/bin/clientaction
               /apps/xvnc/bin/clientaction
+              /usr/lib/mw/bin/clientaction
               ""
         } {
Index: branches/blt4/gui/scripts/grab.tcl
===================================================================
--- branches/blt4/gui/scripts/grab.tcl	(revision 1883)
+++ branches/blt4/gui/scripts/grab.tcl	(revision 1897)
@@ -65,4 +65,9 @@
 	}
 
+        # if the window is already on the stack, then skip it
+        if {[string equal [lindex $::Rappture::grab::stack 0] $window]} {
+            return $window
+        }
+
 	# add the current configuration to the grab stack
 	set ::Rappture::grab::stack \
Index: branches/blt4/gui/scripts/moleculeViewer.tcl
===================================================================
--- branches/blt4/gui/scripts/moleculeViewer.tcl	(revision 1883)
+++ branches/blt4/gui/scripts/moleculeViewer.tcl	(revision 1897)
@@ -700,5 +700,5 @@
 }
 
-itcl::body Rappture::DeviceEditor::snap { w h } {
+itcl::body Rappture::MoleculeViewer::snap { w h } {
     if { $w <= 0 || $h <= 0 } {
 	set w [winfo width $itk_component(area)]
Index: branches/blt4/gui/scripts/sidebarframe.tcl
===================================================================
--- branches/blt4/gui/scripts/sidebarframe.tcl	(revision 1883)
+++ branches/blt4/gui/scripts/sidebarframe.tcl	(revision 1897)
@@ -451,5 +451,5 @@
         release {
             set minw [winfo reqwidth $itk_component(controlbar)]
-            if { $_width != "auto" && ($_width-$minw) < 40} {
+            if {$_width-$minw < 40} {
                 set _width "auto"
                 pop close
Index: branches/blt4/gui/scripts/textentry.tcl
===================================================================
--- branches/blt4/gui/scripts/textentry.tcl	(revision 1883)
+++ branches/blt4/gui/scripts/textentry.tcl	(revision 1897)
@@ -231,5 +231,7 @@
         # take down any existing widget
 	foreach win [pack slaves $itk_interior] {
-            pack forget $win
+	    if { [winfo name $win] != "hints" } {
+		pack forget $win
+	    }
         }
 
Index: branches/blt4/gui/scripts/utils.tcl
===================================================================
--- branches/blt4/gui/scripts/utils.tcl	(revision 1883)
+++ branches/blt4/gui/scripts/utils.tcl	(revision 1897)
@@ -23,8 +23,8 @@
 proc Rappture::utils::hexdump {args} {
     Rappture::getopts args params {
-	value -lines unlimited
+        value -lines unlimited
     }
     if {[llength $args] != 1} {
-	error "wrong # args: should be \"hexdump ?-lines num? data\""
+        error "wrong # args: should be \"hexdump ?-lines num? data\""
     }
     set newval [lindex $args 0]
@@ -34,5 +34,5 @@
 
     if {$params(-lines) != "unlimited" && $params(-lines) <= 0} {
-	return $rval
+        return $rval
     }
 
@@ -40,30 +40,30 @@
     set len [string length $newval]
     for {set i 0} {$i < $len} {incr i 8} {
-	append rval [format "%#06x: " $i]
-	set ascii ""
-	for {set j 0} {$j < 8} {incr j} {
-	    if {$i+$j < $len} {
-		set char [string index $newval [expr {$i+$j}]]
-		binary scan $char c ichar
-		set hexchar [format "%02x" [expr {0xff & $ichar}]]
-	    } else {
-		set char " "
-		set hexchar "  "
-	    }
-	    append rval "$hexchar "
-	    if {[regexp {[\000-\037\177-\377]} $char]} {
-		append ascii "."
-	    } else {
-		append ascii $char
-	    }
-	}
-	append rval " | $ascii\n"
+        append rval [format "%#06x: " $i]
+        set ascii ""
+        for {set j 0} {$j < 8} {incr j} {
+            if {$i+$j < $len} {
+                set char [string index $newval [expr {$i+$j}]]
+                binary scan $char c ichar
+                set hexchar [format "%02x" [expr {0xff & $ichar}]]
+            } else {
+                set char " "
+                set hexchar "  "
+            }
+            append rval "$hexchar "
+            if {[regexp {[\000-\037\177-\377]} $char]} {
+                append ascii "."
+            } else {
+                append ascii $char
+            }
+        }
+        append rval " | $ascii\n"
 
-	if {"unlimited" != $params(-lines) && $i/8+1 >= $params(-lines)} {
-	    if {$i < $len-1} {
-		append rval "more..."
-	    }
-	    break
-	}
+        if {"unlimited" != $params(-lines) && $i/8+1 >= $params(-lines)} {
+            if {$i < $len-1} {
+                append rval "more..."
+            }
+            break
+        }
     }
     return $rval
@@ -78,15 +78,15 @@
 proc Rappture::utils::binsize {size} {
     foreach {factor units} {
-	1073741824 GB
-	1048576 MB
-	1024 kB
-	1 bytes
+        1073741824 GB
+        1048576 MB
+        1024 kB
+        1 bytes
     } {
-	if {$size/$factor > 0} {
-	    if {$factor > 1} {
-		set size [format "%.1f" [expr {double($size)/$factor}]]
-	    }
-	    break
-	}
+        if {$size/$factor > 0} {
+            if {$factor > 1} {
+                set size [format "%.1f" [expr {double($size)/$factor}]]
+            }
+            break
+        }
     }
     return "$size $units"
@@ -127,2 +127,37 @@
     return $desc
 }
+
+# ----------------------------------------------------------------------
+# USAGE: expandPath <path>
+#
+# Returns the true location of the provided path,
+# automatically expanding links to form an absolute path.
+# ----------------------------------------------------------------------
+proc Rappture::utils::expandPath {args} {
+    set path ""
+    set dirs [file split [lindex $args 0]]
+
+    while {[llength $dirs] > 0} {
+        set d [lindex $dirs 0]
+        set dirs [lrange $dirs 1 end]
+        if {[catch {file link [file join $path $d]} out] == 0} {
+            # directory d is a link, follow it
+            set outdirs [file split $out]
+            if {[string compare "/" [lindex $outdirs 0]] == 0} {
+                # directory leads back to root
+                # clear path
+                # reset dirs list
+                set path ""
+                set dirs $outdirs
+            } else {
+                # relative path for the link
+                # prepend directory to dirs list
+                set dirs [concat $outdirs $dirs]
+            }
+        } else {
+            set path [file join $path $d]
+        }
+    }
+    return $path
+}
+
Index: branches/blt4/gui/scripts/xyresult.tcl
===================================================================
--- branches/blt4/gui/scripts/xyresult.tcl	(revision 1883)
+++ branches/blt4/gui/scripts/xyresult.tcl	(revision 1897)
@@ -279,5 +279,5 @@
 	-brightness 0
 	-width 1
-	-type "histogram"
+	-type "line"
 	-raise 0
 	-linestyle solid
