I am trying to figure out the correct method to tie my GUI to the main program. So far all I have is a GUI class that creates all the components. Now I am trying to figure out the proper way to link the GUI to the main program. I assume there is someway to create an instance of the GUI which will call methods in the class that instantiated it when an event is generated by the GUI, or something to
that effect. Most of the examples I have seem seem to tie the GUI to the class that is using it, which to me seems like bad programming practice. I should be able to let any class use the GUI and not require any changes to the GUI?
Most of the examples I have found seem to be very simple and just lump the functionality of the program and the GUI into a single class.
Would it be possible to give a simple example of how this is done?