Storing a custom component pointer

Hi to all,

I have some textbuttons that each one makes a different custom GUI components visible.

I want to store the last "opened" component somewhere, so clicking a different (unique) textButton the last component is set to "hidden".
How could I store a custom component pointer?

Thank you in advance,


It's not entirely clear what you mean by custom component pointer...

If you mean you've got some type T that's derived from Component, then you can use either T* or Component*.

What I meant is that i have some classes derived from component, that I wanted to store somewhere the last that had "setVisible(true)", so I could hide it (setVisible(false)) no matter which it was.

Component* worked fine, thank you Joshua.