Hello all:
I am beginning work on porting one of our lab's unix apps to Mac OS X.
I'm starting with a demo project first. The original app is written in c++ and uses Motif / X-Win for the interface.
I have set up three classes:
Tracker -- c++ class // Performs calculations etc.
Tracker::Tracker( Viewer *view)
{
myViewer = view;
}
Viewer: NSView
Controller: NSResponder
Viewer *ourViewer;
Tracker *ourTracker;
The Tracker class simply begins counting when asked and sends the counter to the terminal window. At this stage, the "Viewer" class is just a place-holder for any interface specific drawing etc. The "Controller" implements all of the possible actions that can be requested through the interface (i.e. all of the connections in MainMenu correspond to a method in Controller).
My question is, once I start a process in "Tracker", how do I use my Controller class to monitor events in the GUI, and kill the process in Tracker if the user clicks a "stop" button in the GUI?
Right now, I've tried to set up Controller to be the first responder etc. I'm keeping a reference to the Viewer class in Tracker, which will be handy to poll the status of GUI stuff later on. However, as of right now I can't make "Tracker" stop counting!
Thanks in advance for any feedback!
Travis
I am beginning work on porting one of our lab's unix apps to Mac OS X.
I'm starting with a demo project first. The original app is written in c++ and uses Motif / X-Win for the interface.
I have set up three classes:
Tracker -- c++ class // Performs calculations etc.
Tracker::Tracker( Viewer *view)
{
myViewer = view;
}
Viewer: NSView
Controller: NSResponder
Viewer *ourViewer;
Tracker *ourTracker;
The Tracker class simply begins counting when asked and sends the counter to the terminal window. At this stage, the "Viewer" class is just a place-holder for any interface specific drawing etc. The "Controller" implements all of the possible actions that can be requested through the interface (i.e. all of the connections in MainMenu correspond to a method in Controller).
My question is, once I start a process in "Tracker", how do I use my Controller class to monitor events in the GUI, and kill the process in Tracker if the user clicks a "stop" button in the GUI?
Right now, I've tried to set up Controller to be the first responder etc. I'm keeping a reference to the Viewer class in Tracker, which will be handy to poll the status of GUI stuff later on. However, as of right now I can't make "Tracker" stop counting!
Thanks in advance for any feedback!
Travis