GUI Addendum to PP1

A simple GUI for the calculator is now available. You can copy a zip file with the required class definitions from /projects/CSE250/ReviewProject.zip

Unzip this zip file in whatever directory you want to keep your CSE250 projects. 'cd' into the ReviewProject directory. To compile and link the GUI as it is, you must run gmake rather than make. gmake is the Gnu version of make, and it has a slightly different syntax than make. If you type 'gmake' at the Unix prompt you should see something like:

g++ -R/util/gnu/lib -c -DUseVGLw -I/projects/alphonce/V/home/vgui/includex -I/util/X11/include  -O -DAthena -o calcGUI.o calcGUI.cpp
g++ -R/util/gnu/lib -c -DUseVGLw -I/projects/alphonce/V/home/vgui/includex -I/util/X11/include  -O -DAthena -o tcmdwin.o tcmdwin.cpp                     
g++ -R/util/gnu/lib -o calcMain ./calcGUI.o ./tcmdwin.o -L/projects/alphonce/V/home/vgui/lib -L/util/X11/lib -lVx -lXaw -lXaw -lXmu -lXt -lXext -lX11
The executable that is produced is called calcMain. Before you can run this you must modify your LD_LIBRARY_PATH environment variable. You should be able to edit your ~/.cshrc file and add the line:
setenv LD_LIBRARY_PATH /usr/openwin/lib:/util/X11/lib
If you already have this variale defined, add /usr/openwin/lib and /util/X11/lib to this path as required. Once you have saved your ~/.cshrc file you must type source ~/.cshrc to ensure that the changes you just made take effect. (You only need to do this once - your ~/.cshrc file is read each time you log in and open a new window.)

You should now be able to run the program by typing calcMain at the Unix prompt.

To use this GUI with your program, you need to make changes only to tcmdwin.h and tcmdwin.cpp. In tcmdwin.h you should only need to declare a variable which can refer to an object from your model code. In tcmdwin.cpp you must edit the large switch towards the end of the file so that appropriate calls can be made into your code.

Your model will need to update the display of the GUI. There is a single method provided for this purpose: void setDisplay(int).

The last thing you will need to do is modify the Makefile. I will provide some guidance to help you do this correctly, as will the TAs.

Please note that you will not be providing a main method to start the program running. Instead, the graphical framework does this for you.


Carl G. Alphonce
Last modified: Tue Jan 27 20:14:42 EST 2004