title: How to implement callbacks that are virtual functions?
body: <p>I am using wxWigets, but I suppose this question is more of how to implement callbacks that are virtual functions. This is a (very) simplified version of my code: </p>
  
  <pre><code>// MyGUI.h 
  Class MyGUI : public wxFrame {
  
    ...
    protected:
       virtual void onFeedButton_cb( wxCommandEvent&amp; event ) { event.Skip(); }
    ...
  }
  
  // Animal.h 
  Class Animal {
  
    public: 
         void Feed(); 
  }
  </code></pre>
  
  <p>A trivial question: How do I implement the onFeedButton_cb callback so that it can access Animal's Feed() function?? i.e. during run time the callback must have access to an instance of Animal. </p>