I was trying to implement a GUI system and I ended up with the idea of allocating items, like buttons, to a list like Casey did with the renderer, pushing the different types of draw objects into a preallocated slot of memory.
I was wondering if it would be a good idea to store a function pointer on each GUI object, like a button, so I could go through the list of GUI items and if the user interacts with one, I just call the function pointer to initiate the pre-defined action. This feels rather like an object-orientated design, and was wondering if this is a good way of doing things?