Index: branches/1.3/gui/scripts/vtkviewer.tcl
===================================================================
--- branches/1.3/gui/scripts/vtkviewer.tcl	(revision 4477)
+++ branches/1.3/gui/scripts/vtkviewer.tcl	(revision 4478)
@@ -95,4 +95,5 @@
     private method EventuallySetAtomScale { args } 
     private method EventuallySetBondScale { args } 
+    private method EventuallySetGlyphsOpacity { args } 
     private method EventuallySetMoleculeOpacity { args } 
     private method EventuallySetMoleculeQuality { args } 
@@ -108,4 +109,5 @@
     private method SetBondScale {}
     private method SetColormap { dataobj comp }
+    private method SetGlyphsOpacity {}
     private method SetLegendTip { x y }
     private method SetMoleculeOpacity {}
@@ -209,4 +211,10 @@
     $_dispatcher dispatch $this !polydataOpacity \
         "[itcl::code $this SetPolydataOpacity]; list"
+
+    # Glyphs opacity event
+    $_dispatcher register !glyphsOpacity
+    $_dispatcher dispatch $this !glyphsOpacity \
+        "[itcl::code $this SetGlyphsOpacity]; list"
+
     #
     # Populate parser with commands handle incoming requests
@@ -508,4 +516,14 @@
 }
 
+itcl::body Rappture::VtkViewer::SetGlyphsOpacity {} {
+    set _glyphsOpacityPending 0
+    foreach dataset [CurrentDatasets -visible $_first] {
+        foreach { dataobj comp } [split $dataset -] break
+        if { [$dataobj type $comp] == "glyphs" } {
+            SetOpacity $dataset
+        }
+    }
+}
+
 itcl::body Rappture::VtkViewer::SetPolydataOpacity {} {
     set _polydataOpacityPending 0
@@ -550,4 +568,11 @@
         set _polydataOpacityPending 1
         $_dispatcher event -after $_scaleDelay !polydataOpacity
+    }
+}
+
+itcl::body Rappture::VtkViewer::EventuallySetGlyphsOpacity { args } {
+    if { !$_glyphsOpacityPending } {
+        set _glyphsOpacityPending 1
+        $_dispatcher event -after $_scaleDelay !glyphsOpacity
     }
 }
@@ -1357,5 +1382,5 @@
         }
         "glyphs-outline" {
-            set bool $_settings(glyphs-outline)
+            set bool $_settings($what)
             foreach dataset [CurrentDatasets -visible $_first] {
                 foreach { dataobj comp } [split $dataset -] break
@@ -1367,5 +1392,5 @@
         }
         "glyphs-wireframe" {
-            set bool $_settings(glyphs-wireframe)
+            set bool $_settings($what)
             foreach dataset [CurrentDatasets -visible $_first] {
                 foreach { dataobj comp } [split $dataset -] break
@@ -1377,5 +1402,5 @@
         }
         "glyphs-visible" {
-            set bool $_settings(glyphs-visible)
+            set bool $_settings($what)
             foreach dataset [CurrentDatasets -visible $_first] {
                 foreach { dataobj comp } [split $dataset -] break
@@ -1387,5 +1412,5 @@
         }
         "glyphs-lighting" {
-            set bool $_settings(glyphs-lighting)
+            set bool $_settings($what)
             foreach dataset [CurrentDatasets -visible $_first] {
                 foreach { dataobj comp } [split $dataset -] break
@@ -1397,5 +1422,5 @@
         }
         "glyphs-edges" {
-            set bool $_settings(glyphs-edges)
+            set bool $_settings($what)
             foreach dataset [CurrentDatasets -visible $_first] {
                 foreach { dataobj comp } [split $dataset -] break
@@ -1408,5 +1433,5 @@
         "glyphs-palette" {
             set palette [$itk_component(glyphspalette) value]
-            set _settings(glyphs-palette) $palette
+            set _settings($what) $palette
             foreach dataset [CurrentDatasets -visible $_first] {
                 foreach {dataobj comp} [split $dataset -] break
@@ -1429,5 +1454,5 @@
         }
         "polydata-outline" {
-            set bool $_settings(polydata-outline)
+            set bool $_settings($what)
             foreach dataset [CurrentDatasets -visible $_first] {
                 foreach { dataobj comp } [split $dataset -] break
@@ -1439,5 +1464,5 @@
         }
         "polydata-wireframe" {
-            set bool $_settings(polydata-wireframe)
+            set bool $_settings($what)
             foreach dataset [CurrentDatasets -visible $_first] {
                 foreach { dataobj comp } [split $dataset -] break
@@ -1449,5 +1474,5 @@
         }
         "polydata-visible" {
-            set bool $_settings(polydata-visible)
+            set bool $_settings($what)
             foreach dataset [CurrentDatasets -visible $_first] {
                 foreach { dataobj comp } [split $dataset -] break
@@ -1459,5 +1484,5 @@
         }
         "polydata-lighting" {
-            set bool $_settings(polydata-lighting)
+            set bool $_settings($what)
             foreach dataset [CurrentDatasets -visible $_first] {
                 foreach { dataobj comp } [split $dataset -] break
@@ -1469,5 +1494,5 @@
         }
         "polydata-edges" {
-            set bool $_settings(polydata-edges)
+            set bool $_settings($what)
             foreach dataset [CurrentDatasets -visible $_first] {
                 foreach { dataobj comp } [split $dataset -] break
@@ -1480,5 +1505,5 @@
         "polydata-palette" {
             set palette [$itk_component(meshpalette) value]
-            set _settings(polydata-palette) $palette
+            set _settings($what) $palette
             foreach dataset [CurrentDatasets -visible $_first] {
                 foreach {dataobj comp} [split $dataset -] break
@@ -1501,5 +1526,5 @@
         }
         "molecule-outline" {
-            set bool $_settings(molecule-outline)
+            set bool $_settings($what)
             foreach dataset [CurrentDatasets -visible $_first] {
                 foreach { dataobj comp } [split $dataset -] break
@@ -1511,5 +1536,5 @@
         }
         "molecule-wireframe" {
-            set bool $_settings(molecule-wireframe)
+            set bool $_settings($what)
             foreach dataset [CurrentDatasets -visible $_first] {
                 foreach { dataobj comp } [split $dataset -] break
@@ -1521,5 +1546,5 @@
         }
         "molecule-visible" {
-            set bool $_settings(molecule-visible)
+            set bool $_settings($what)
             foreach dataset [CurrentDatasets -visible $_first] {
                 foreach { dataobj comp } [split $dataset -] break
@@ -1531,5 +1556,5 @@
         }
         "molecule-lighting" {
-            set bool $_settings(molecule-lighting)
+            set bool $_settings($what)
             foreach dataset [CurrentDatasets -visible $_first] {
                 foreach { dataobj comp } [split $dataset -] break
@@ -1541,5 +1566,5 @@
         }
         "molecule-edges" {
-            set bool $_settings(molecule-edges)
+            set bool $_settings($what)
             foreach dataset [CurrentDatasets -visible $_first] {
                 foreach { dataobj comp } [split $dataset -] break
@@ -1552,5 +1577,5 @@
         "molecule-palette" {
             set palette [$itk_component(moleculepalette) value]
-            set _settings(molecule-palette) $palette
+            set _settings($what) $palette
             foreach dataset [CurrentDatasets -visible $_first] {
                 foreach {dataobj comp} [split $dataset -] break
@@ -1649,15 +1674,15 @@
             set value [$itk_component(rscale) value]
             set value [$itk_component(rscale) translate $value]
-            set _settings(molecule-rscale) $value
+            set _settings($what) $value
             foreach dataset [CurrentDatasets -visible $_first] {
                 foreach {dataobj comp} [split $dataset -] break
                 set type [$dataobj type $comp]
                 if { $type == "molecule" } {
-                    SendCmd [subst {molecule rscale $_settings(molecule-rscale) $dataset}]
+                    SendCmd [subst {molecule rscale $_settings($what) $dataset}]
                 }
             }
         }
         "molecule-labels" {
-            set bool $_settings(molecule-labels)
+            set bool $_settings($what)
             foreach dataset [CurrentDatasets -visible $_first] {
                foreach { dataobj comp } [split $dataset -] break
@@ -1996,5 +2021,5 @@
         -width 10 \
         -showvalue off \
-        -command [itcl::code $this AdjustSetting glyphs-opacity]
+        -command [itcl::code $this EventuallySetGlyphsOpacity]
     $inner.opacity set $_settings(glyphs-opacity)
 
@@ -2068,5 +2093,5 @@
         -width 10 \
         -showvalue off \
-        -command [itcl::code $this AdjustSetting polydata-opacity]
+        -command [itcl::code $this EventuallySetPolydataOpacity]
     $inner.opacity set $_settings(polydata-opacity)
 
