title: DOORS DXL: Unable to operate against global button // toggling control active/inactive
body: <p>Alright, so, I found the helpful answer as to how to enable/disable (active/inactive) a control using DXL, but now I feel I have a problem that I don't understand, somehow relative to the order in which the functions are loaded.</p>
  
  <p>Problem: When I create a dialog, I have two buttons, one button is inactive shortly after being created.  When I press Button 1, I want to force Button 2 to become active, but instead, I get an error stating that Button 2 is unassigned, which is strange because it was declared globally and setup in the main function.  So, what am I doing wrong??</p>
  
  <p>Here is my code...</p>
  
  <pre><code>pragma runLim,10000
  
  DB main_dialog = null
  DBE main_button1 = null
  DBE main_button2 = null
  
  void toggle_visibility_other_button(DBE dbe)
  {
      active(main_button2)
  }
  
  void do_something(DBE dbe)
  {
      infoBox "UNDER CONSTRUCTION"
  }
  
  void main_function()
  {   
      main_dialog = create("My GUI", styleCentered)
      main_button1 = button(main_dialog, "Button 1", toggle_visibility_other_button)
      main_button2 = button(main_dialog, "Button 2", do_something)
  
      inactive(main_button2)
  
      realize(main_dialog)
      setSize(main_dialog, 300, 150)
  }
  
  main_function
  </code></pre>