Creating Custom Button Behaviour. Is This Wrong?

In your button example, what's the advantage of having the array of function pointers outside of the button class?

If each button say 0-49 corresponds to one function inside the array of function pointers (also 0-49).... So buttons[35] goes with funcPtrs[35] etc. Then to my uninitiated mind it seems more logical to have the function pointer grouped in with each button object rather than referenced in an external array.

I'm in no way arguing that your code isn't better, just trying the understand the 'whats and whys' of this stuff so I can do things better/correctly.

Also, how are things like GUI menus/button set up then? Such as a File, Save, Open type of menu setup. Assuming that each button in a menu has to 'do something' do they all relate to a function pointer like in my/your code, or would each button/menu item inherit from a button class and override an execute function?