0

I'm developing a GUI for my mbed microcontroller and have a small question. I use a TFT class which has functions like TFTobject->drawrect(x,y,height, width)

Now I want to use classes like Button and Slider that have an abstract class InterfaceElement. But each Button or Slider needs access to the drawrect class. How can I do this the easiest without using a pointer to the TFTobject for each button/slider (Can't imagine this would be the way to do that)?

Thanks

Jannes
  • 29
  • 9

1 Answers1

0

First drawrect() appears to be a function then you describe it as a class? Maybe I'm confused because I'm tired...

Either way it sounds like you're describing a Static class/function- check out this question and answer also posted on StackOverflow:

How do you create a static class in C++?

Community
  • 1
  • 1
jProg2015
  • 1,098
  • 10
  • 40