title: Update one Pmw control using value from another within the same class
body: <p>I am writing a Pmw (<a href="http://pmw.sourceforge.net" rel="nofollow">http://pmw.sourceforge.net</a>) plugin for PyMOL (<a href="http://sourceforge.net/projects/pymol/" rel="nofollow">http://sourceforge.net/projects/pymol/</a>), but I just cannot update the value of a <code>Pmw.ComboBox</code> using changes made to a <code>Pmw.RadioSelect</code> control.</p>
  
  <p>The error I keep getting is:</p>
  
  <pre><code>    File "/Users/x/.pymol/plugins/mymixer.py", line 82, in sdqRadioChanged
      self.scheme_listing._list.setlist(scList)
  &lt;type 'exceptions.AttributeError'&gt;: MyMixer instance has no attribute 'scheme_listing'
  </code></pre>
  
  <p>This appears to be a mistake in scope, but I have no idea how to re-architect the entire plugin to be able to access the <code>scheme_listing</code> attribute of a <code>MyMixer</code> instance. Similar examples for python/Pmw/tkinter, on the web, appear to work fine (or so it appears to me with my limited understanding of python GUI programming).</p>
  
  <p>Attached below is a MWE that runs (and fails) from within PyMOL (shows up in the menu under Plugins > MyMixer). Note: If you run this on OSX, make sure you are running PyMOLX11Hybrid.app</p>
  
  <pre><code># -*- coding: utf-8 -*-
  
  # ==========================
  # IMPORTS
  # ==========================
  
  import Pmw
  
  # ==========================
  #  MAIN CLASS
  # ==========================
  
  class MyMixer():
  
      colbrew = {'color':{'red': ['apple', 'strawberry', 'carrot'],
                      'blue': ['blueberry', 'smurfberry', 'icee'],
                      'green': ['spinach', 'chilli', 'lettuce']},
                 'shape':{'round': ['baseball', 'basketball', 'golfball'],
                      'oblong': ['football', 'shoes', 'eggs'],
                      'square': ['box', 'laptop', 'yourhead']}}
  
      def __init__(self, app):
  
          parent = app.root
          self.parent = parent
          self.dialog = Pmw.Dialog(parent, buttons=('Exit', ),
                               title='MyMixer Plugin',
                               command=self.button_pressed)
          self.dialog.geometry('650x780')
          self.dialog.bind('&lt;Return&gt;', self.button_pressed)
  
          # -- Initialize main notebook
          self.notebook = Pmw.NoteBook(self.dialog.interior())
          self.notebook.pack(fill='both', expand=1, padx=3, pady=3)
  
          self.sdq_radio = Pmw.RadioSelect(self.dialog.interior(),
                                       selectmode='single',
                                       buttontype='radiobutton',
                                       labelpos='nw',
                                       label_text='Colbrew Style:',
                                       label_font='inconsolata 16',
                                       orient='horizontal',
                                       frame_relief='ridge',
                                       command=self.sdqRadioChanged)
  
          self.sdq_radio.pack(padx=0, anchor='n')
  
          schemeStyleTypes = self.colbrew.keys()
  
          for item in schemeStyleTypes:
              self.sdq_radio.add(item, font='inconsolata 16')
  
          self.sdq_radio.invoke(0)
  
          scListItems = self.colbrew.get(self.sdq_radio.getvalue())
  
          self.scheme_listing = Pmw.ComboBox(self.dialog.interior(),
                                      scrolledlist_items=scListItems,
                                      labelpos='nw',
                                      label_text='Scheme Name:',
                                      label_font='inconsolata 16',
                                      listbox_height=10,
                                      entry_width=3,
                                      selectioncommand=self.schemeListCommand,
                                      dropdown=True)
  
          self.scheme_listing.pack(padx=20, pady=2, anchor='e')
  
          # -- Reflow notebook
  
          self.notebook.setnaturalsize()
  
          # -- Show the main dialog
  
          self.dialog.show()
  
      def schemeListCommand(self, value):
          print value
  
      def sdqRadioChanged(self, value):
          scList = self.colbrew.get(value)
          self.scheme_listing._list.setlist(scList) # THIS IS THE POINT OF FAILURE !!!
          print value
  
      # -- Utility function for button controls
  
      def button_pressed(self, result):
          if result == 'Exit' or result is None:
             self.dialog.withdraw()
  
  # ==========================
  #  PLUGIN INITIALIZATION
  # ==========================
  
  def __init__(self, *args):
      self.menuBar.addmenuitem('Plugin', 'command', 'Start MyMixer',
                           label='MyMixer',
                           command=lambda s=self: MyMixer(s))
  </code></pre>