title: C++ dynamically show or hide FLTK widgets?
body: <p>I'm new to C++ and never used macros before but I beleive they may allow me to solve the following problem although I would welcome alternative solutions.</p>
  
  <p>I have written the following macro:</p>
  
  <pre><code>#define COMMAND(NUMBER){ button_ ## NUMBER ## -&gt;hide(); }
  </code></pre>
  
  <p>and I want to call it like this</p>
  
  <pre><code>for (int i = 1; i &lt; 10; i++)
  {
      COMMAND(i)
  }
  </code></pre>
  
  <p>in the hope that when the program executes it would do the equivalent of:</p>
  
  <pre><code>button_1-&gt;hide();
  button_2-&gt;hide();
  button_3-&gt;hide();
  button_4-&gt;hide();
         .
         .
  button_10-&gt;hide();
  </code></pre>
  
  <p>The idea is that I want to make a FLTK GUI display/hide widgets dynamically depending on a configuration file being read in when the form is loaded.</p>
  
  <p>Unfortunately it appears that the macro above doesn't work and instead what it does is</p>
  
  <pre><code>button_i-&gt;hide();
  </code></pre>
  
  <p>which causes a compile error because button_i doesn't exist!</p>
  
  <p>So my questions are:<br>
  A) Is it possible to do this in C++?<br>
  B) Is a macro able to accomplish this?<br>
  C) If not what can?<br>
  D) If macros can do this then how do I amend the above code to actually get it to work!  </p>
  
  <p>Thanks</p>