chili wrote:
Now I'm not 100% clear about what your problem is though. You say: "I'm not quite grasping when and where (.cpp/.h?) to create objects to access things". Maybe there's a little disconnect in terminology.
I'm sure there's a disconnect with a lot of things
I feel honored to speak to the man himself
Must have heard your voice for over 30 hours now, love the comedic relief, thanks for taking time to teach others, I've felt very welcomed by the programming world, I think there is something that draws similar characters to this interest. no homo
What I was getting lost on was essentially what albinopapa touched on with:
albinopapa wrote:First off, if you are going to have a Keyboard object in the Control class, then you don't have to pass a Keyboard & to KeyPress. If keyOb is suppose to be a reference to the one stored in MainWindow, then you'd need to make keyOb a Keyboard & and initialize it using the Control constructor.
I was confused as to how to allow a new class access to the Keyboard, what the role of the constructor was, and if I could declare a Graphics object in the header file of another class to access PutPixel.
I had tried sending variables along with graphics& reference into a new class's constructor but came up against errors. I'm assuming the constructor only accepts certain arguments? (sorry if I'm butchering the terminology).
I'm going to try implimenting albinopapa's advice now, allowing access by passing graphics pointer in the constructor and then declaring a graphics object to access PutPixel.. at least that's what I think is being suggested haha, soon to find out.
albinopapa wrote:Just as a warning, you are declaring new variables here, not assigning new values to the members of Control.
Oops, thanks for pointing that out
it was pushing 5am when I hastily tackled that
I'm in the UK (GMT) hence the delayed response.