title: How to call function on button click?
body: <p>I have a Processing class, called Button, which has the following function <code>onClick</code>:</p>
  
  <pre><code>class Button() {
      // Extra code
      void onClick() {
          // Run function here
      }
  }
  </code></pre>
  
  <p>which is supposed to trigger a function call when the button is clicked, and the function is taken in from an argument, like so:</p>
  
  <pre><code>Button test = new Button(..., callFunction())
  </code></pre>
  
  <p>Where <code>callFunction()</code> is guaranteed to be a <code>void</code> function. How do I call the function <code>callFunction()</code> once <code>test</code> is clicked on? I can check if the button is clicked, but I have no idea how to wire that to a function call provided by an argument.</p>