Index: /trunk/gui/scripts/vtkheightmapviewer.tcl
===================================================================
--- /trunk/gui/scripts/vtkheightmapviewer.tcl	(revision 6354)
+++ /trunk/gui/scripts/vtkheightmapviewer.tcl	(revision 6355)
@@ -103,4 +103,5 @@
     private method Rotate {option x y}
     private method SetCurrentColormap { color }
+    private method SetCurrentFieldName { dataobj }
     private method SetLegendTip { x y }
     private method SetObjectStyle { dataobj comp }
@@ -960,4 +961,5 @@
         if { [info exists _obj2ovride($dataobj-raise)] &&  $_first == "" } {
             set _first $dataobj
+            SetCurrentFieldName $dataobj
         }
         foreach comp [$dataobj components] {
@@ -1001,35 +1003,6 @@
         }
     }
-    if { $_first != "" } {
-        $itk_component(field) choices delete 0 end
-        $itk_component(fieldmenu) delete 0 end
-        array unset _fields
-        set _curFldName ""
-        foreach cname [$_first components] {
-            foreach fname [$_first fieldnames $cname] {
-                if { [info exists _fields($fname)] } {
-                    continue
-                }
-                foreach { label units components } \
-                    [$_first fieldinfo $fname] break
-                $itk_component(field) choices insert end "$fname" "$label"
-                $itk_component(fieldmenu) add radiobutton -label "$label" \
-                    -value $label -variable [itcl::scope _curFldLabel] \
-                    -selectcolor red \
-                    -activebackground $itk_option(-plotbackground) \
-                    -activeforeground $itk_option(-plotforeground) \
-                    -font "Arial 8" \
-                    -command [itcl::code $this LegendTitleAction save]
-                set _fields($fname) [list $label $units $components]
-                if { $_curFldName == "" } {
-                    set _curFldName $fname
-                    set _curFldLabel $label
-                }
-            }
-        }
-        $itk_component(field) value $_curFldLabel
-    }
+
     InitSettings -stretchtofit -outline
-
     if { $_reset } {
         SendCmd "axis tickpos outside"
@@ -2679,2 +2652,33 @@
     blt::vector destroy $v
 }
+
+itcl::body Rappture::VtkHeightmapViewer::SetCurrentFieldName { dataobj } {
+    set _first $dataobj
+    $itk_component(field) choices delete 0 end
+    $itk_component(fieldmenu) delete 0 end
+    array unset _fields
+    set _curFldName ""
+    foreach cname [$_first components] {
+        foreach fname [$_first fieldnames $cname] {
+            if { [info exists _fields($fname)] } {
+                continue
+            }
+            foreach { label units components } \
+                [$_first fieldinfo $fname] break
+            $itk_component(field) choices insert end "$fname" "$label"
+            $itk_component(fieldmenu) add radiobutton -label "$label" \
+                -value $label -variable [itcl::scope _curFldLabel] \
+                -selectcolor red \
+                -activebackground $itk_option(-plotbackground) \
+                -activeforeground $itk_option(-plotforeground) \
+                -font "Arial 8" \
+                -command [itcl::code $this LegendTitleAction save]
+            set _fields($fname) [list $label $units $components]
+            if { $_curFldName == "" } {
+                set _curFldName $fname
+                set _curFldLabel $label
+            }
+        }
+    }
+    $itk_component(field) value $_curFldLabel
+}
Index: /trunk/gui/scripts/vtkimageviewer.tcl
===================================================================
--- /trunk/gui/scripts/vtkimageviewer.tcl	(revision 6354)
+++ /trunk/gui/scripts/vtkimageviewer.tcl	(revision 6355)
@@ -100,4 +100,5 @@
     private method Rotate {option x y}
     private method SetCurrentColormap { color }
+    private method SetCurrentFieldName { dataobj }
     private method SetLegendTip { x y }
     private method SetObjectStyle { dataobj comp }
@@ -932,4 +933,5 @@
         if { [info exists _obj2ovride($dataobj-raise)] &&  $_first == "" } {
             set _first $dataobj
+            SetCurrentFieldName $dataobj
         }
         foreach comp [$dataobj components] {
@@ -968,35 +970,6 @@
         }
     }
-    if { $_first != ""  } {
-        $itk_component(field) choices delete 0 end
-        $itk_component(fieldmenu) delete 0 end
-        array unset _fields
-        set _curFldName ""
-        foreach cname [$_first components] {
-            foreach fname [$_first fieldnames $cname] {
-                if { [info exists _fields($fname)] } {
-                    continue
-                }
-                foreach { label units components } \
-                    [$_first fieldinfo $fname] break
-                $itk_component(field) choices insert end "$fname" "$label"
-                $itk_component(fieldmenu) add radiobutton -label "$label" \
-                    -value $label -variable [itcl::scope _curFldLabel] \
-                    -selectcolor red \
-                    -activebackground $itk_option(-plotbackground) \
-                    -activeforeground $itk_option(-plotforeground) \
-                    -font "Arial 8" \
-                    -command [itcl::code $this LegendTitleAction save]
-                set _fields($fname) [list $label $units $components]
-                if { $_curFldName == "" } {
-                    set _curFldName $fname
-                    set _curFldLabel $label
-                }
-            }
-        }
-        $itk_component(field) value $_curFldLabel
-    }
+
     InitSettings -stretchtofit -outline
-
     if { $_reset } {
         SendCmd "axis tickpos outside"
@@ -2327,2 +2300,33 @@
     set _view(-zoom) 1.0
 }
+
+itcl::body Rappture::VtkImageViewer::SetCurrentFieldName { dataobj } {
+    set _first $dataobj
+    $itk_component(field) choices delete 0 end
+    $itk_component(fieldmenu) delete 0 end
+    array unset _fields
+    set _curFldName ""
+    foreach cname [$_first components] {
+        foreach fname [$_first fieldnames $cname] {
+            if { [info exists _fields($fname)] } {
+                continue
+            }
+            foreach { label units components } \
+                [$_first fieldinfo $fname] break
+            $itk_component(field) choices insert end "$fname" "$label"
+            $itk_component(fieldmenu) add radiobutton -label "$label" \
+                -value $label -variable [itcl::scope _curFldLabel] \
+                -selectcolor red \
+                -activebackground $itk_option(-plotbackground) \
+                -activeforeground $itk_option(-plotforeground) \
+                -font "Arial 8" \
+                -command [itcl::code $this LegendTitleAction save]
+            set _fields($fname) [list $label $units $components]
+            if { $_curFldName == "" } {
+                set _curFldName $fname
+                set _curFldLabel $label
+            }
+        }
+    }
+    $itk_component(field) value $_curFldLabel
+}
Index: /trunk/gui/scripts/vtkstreamlinesviewer.tcl
===================================================================
--- /trunk/gui/scripts/vtkstreamlinesviewer.tcl	(revision 6354)
+++ /trunk/gui/scripts/vtkstreamlinesviewer.tcl	(revision 6355)
@@ -105,4 +105,5 @@
     private method Rotate {option x y}
     private method SetCurrentColormap { color }
+    private method SetCurrentFieldName { dataobj }
     private method SetLegendTip { x y }
     private method SetObjectStyle { dataobj comp }
@@ -978,4 +979,5 @@
         if { [info exists _obj2ovride($dataobj-raise)] &&  $_first == "" } {
             set _first $dataobj
+            SetCurrentFieldName $dataobj
         }
         foreach comp [$dataobj components] {
@@ -1023,32 +1025,4 @@
             }
         }
-        $itk_component(field) choices delete 0 end
-        $itk_component(fieldmenu) delete 0 end
-        array unset _fields
-        set _curFldName ""
-        set _curFldLabel ""
-        foreach cname [$_first components] {
-            foreach fname [$_first fieldnames $cname] {
-                if { [info exists _fields($fname)] } {
-                    continue
-                }
-                foreach { label units components } \
-                    [$_first fieldinfo $fname] break
-                $itk_component(field) choices insert end "$fname" "$label"
-                $itk_component(fieldmenu) add radiobutton -label "$label" \
-                    -value $label -variable [itcl::scope _curFldLabel] \
-                    -selectcolor red \
-                    -activebackground $itk_option(-plotbackground) \
-                    -activeforeground $itk_option(-plotforeground) \
-                    -font "Arial 8" \
-                    -command [itcl::code $this LegendTitleAction save]
-                set _fields($fname) [list $label $units $components]
-                if { $_curFldName == "" && $components == 3 } {
-                    set _curFldName $fname
-                    set _curFldLabel $label
-                }
-            }
-        }
-        $itk_component(field) value $_curFldLabel
     }
 
@@ -2434,2 +2408,34 @@
     set _view(-zoom) 1.0
 }
+
+itcl::body Rappture::VtkStreamlinesViewer::SetCurrentFieldName { dataobj } {
+    set _first $dataobj
+    $itk_component(field) choices delete 0 end
+    $itk_component(fieldmenu) delete 0 end
+    array unset _fields
+    set _curFldName ""
+    set _curFldLabel ""
+    foreach cname [$_first components] {
+        foreach fname [$_first fieldnames $cname] {
+            if { [info exists _fields($fname)] } {
+                continue
+            }
+            foreach { label units components } \
+                [$_first fieldinfo $fname] break
+            $itk_component(field) choices insert end "$fname" "$label"
+            $itk_component(fieldmenu) add radiobutton -label "$label" \
+                -value $label -variable [itcl::scope _curFldLabel] \
+                -selectcolor red \
+                -activebackground $itk_option(-plotbackground) \
+                -activeforeground $itk_option(-plotforeground) \
+                -font "Arial 8" \
+                -command [itcl::code $this LegendTitleAction save]
+            set _fields($fname) [list $label $units $components]
+            if { $_curFldName == "" && $components == 3 } {
+                set _curFldName $fname
+                set _curFldLabel $label
+            }
+        }
+    }
+    $itk_component(field) value $_curFldLabel
+}
Index: /trunk/gui/scripts/vtkvolumeviewer.tcl
===================================================================
--- /trunk/gui/scripts/vtkvolumeviewer.tcl	(revision 6354)
+++ /trunk/gui/scripts/vtkvolumeviewer.tcl	(revision 6355)
@@ -115,4 +115,5 @@
     private method Rotate {option x y}
     private method SendTransferFunctions {}
+    private method SetCurrentFieldName { dataobj }
     private method SetInitialTransferFunction { dataobj cname }
     private method SetLegendTip { x y }
@@ -1017,4 +1018,5 @@
         if { [info exists _obj2ovride($dataobj-raise)] &&  $_first == "" } {
             set _first $dataobj
+            SetCurrentFieldName $dataobj
         }
         foreach cname [$dataobj components] {
@@ -1063,34 +1065,4 @@
             }
         }
-        $itk_component(field) choices delete 0 end
-        $itk_component(fieldmenu) delete 0 end
-        array unset _fields
-        set _curFldName ""
-        foreach cname [$_first components] {
-            foreach fname [$_first fieldnames $cname] {
-                if { [info exists _fields($fname)] } {
-                    continue
-                }
-                foreach { label units components } \
-                    [$_first fieldinfo $fname] break
-                # Only scalar fields are valid
-                if {$_allowMultiComponent || $components == 1} {
-                    $itk_component(field) choices insert end "$fname" "$label"
-                    $itk_component(fieldmenu) add radiobutton -label "$label" \
-                        -value $label -variable [itcl::scope _curFldLabel] \
-                        -selectcolor red \
-                        -activebackground $itk_option(-plotbackground) \
-                        -activeforeground $itk_option(-plotforeground) \
-                        -font "Arial 8" \
-                        -command [itcl::code $this LegendTitleAction save]
-                    set _fields($fname) [list $label $units $components]
-                    if { $_curFldName == "" } {
-                        set _curFldName $fname
-                        set _curFldLabel $label
-                    }
-                }
-            }
-        }
-        $itk_component(field) value $_curFldLabel
     }
 
@@ -2864,2 +2836,36 @@
     return [ColorsToColormap $color]
 }
+
+itcl::body Rappture::VtkVolumeViewer::SetCurrentFieldName { dataobj } {
+    set _first $dataobj
+    $itk_component(field) choices delete 0 end
+    $itk_component(fieldmenu) delete 0 end
+    array unset _fields
+    set _curFldName ""
+    foreach cname [$_first components] {
+        foreach fname [$_first fieldnames $cname] {
+            if { [info exists _fields($fname)] } {
+                continue
+            }
+            foreach { label units components } \
+                [$_first fieldinfo $fname] break
+            # Only scalar fields are valid
+            if {$_allowMultiComponent || $components == 1} {
+                $itk_component(field) choices insert end "$fname" "$label"
+                $itk_component(fieldmenu) add radiobutton -label "$label" \
+                    -value $label -variable [itcl::scope _curFldLabel] \
+                    -selectcolor red \
+                    -activebackground $itk_option(-plotbackground) \
+                    -activeforeground $itk_option(-plotforeground) \
+                    -font "Arial 8" \
+                    -command [itcl::code $this LegendTitleAction save]
+                set _fields($fname) [list $label $units $components]
+                if { $_curFldName == "" } {
+                    set _curFldName $fname
+                    set _curFldLabel $label
+                }
+            }
+        }
+    }
+    $itk_component(field) value $_curFldLabel
+}
