Computer Science 2574 |
Intro to Data Structures & Soft Eng
|
The Amulet GUI library is no longer being used in CS 1704. Students may learn about Amulet on their own, but it may NOT be used in the implementation of course assignments. The Amulet library is no longer being supported by the CS 1704 instructor(s) or TA(s). |
The Amulet (Automatic Manufacture of Usable and Learnable Editors and Toolkits) GUI is a cross-platform C++ library. Developed at the CS Dept at Carnegie-Mellon Univ. in the CMU HCI Institute team lead by Dr. Brad Myers, Senior Research Scientist. (Please do NOT join the Amulet listservs until reading further.)
Downloading
To get started with Amulet under MS Windows using MS Visual C++, visit the Amulet home page and download the Amulet 3.0 zip archive. Download the Amulet 3.0 Reference Manual in Acrobat PDF format.
Installation
Follow the instructions in chapter 1.4.3 of the reference manual for Installing Amulet on a PC. Some further suggestions are listed below:
- When decompressing the Amulet 3.0 zip archive. you may install it in any subdirectory, but I recommend install it off the root of a drive (d:\amulet). Be sure to check the WinZip "Use Folder Names" option when unzipping.To avoid possible problems do not install it under a folder directory which contains spaces in any of the folder names. A total of approximately 90MB will be needed for a complete installation and library build.
- Add the Amulet environment variables to your system using the directions in section 1.4.3.2. Under NT, open the system contol panel and bring the Environment tab forward. Enter the amulet environment variable name and its value at the bottom of the dialog and hit set to store, for each variable. Be sure to use "Makefile.vars.MSVC5.Win32" value for the AMULET_VARS_FILE variable regardless of whether you are using version 5.0 or 6.0 of MS Visual C++.
- To build the Amulet library and accompanying programs open the amulet.mak makefile in the bin directory under the amulet install directory. In MS Visual C++ you will need to select File -> Open Workspace... and set the dialog File of type: field entry to Makefiles (.mak). From the Build menu select Build all. The library and support programs are rather extensive and will take some time to compile and link.
Learning Amulet
In order to learn Amulet all students must read and work their way through Chapter 2, "Amulet Tutorial" in the Amulet 3.0 Reference Manual. This will require you to copy the Amulet tutorial dir and compile it. (When opening the copied tutorial workspace the first time, you will need to change the Files of type: in the Open Workspace dialog to Projects (.dsp) -- allow MSVC to go ahead and convert it if it asks.)
MSVC will not be able to find the <amulet.h> header file and the amulet.lib file unless you do the following. From the Tools menu, select Options and click on the Directories tab. In the Show directories for menu: choose Include files and add d:\amulet\include in the Directories list. Then choose Library files and add d:\amulet\lib in the Directories list. This is described in section 1.4.3.4.1 of the Amulet manual. The following section describes how to create your own project file for Amulet, but you need to go through the tutorial first.)
Creating Amulet Projects
- Copy the d:\amulet\samples\tutorial existing project into your own filespace
- Rename all of the tutorial files and tutorial folder to your project name
- Select File menu -> New.. and in the New dialog, click Project Tab and select the Add to current workspace radio button. Select the Win32 Application and then enter your own project name.
- Delete the tutorial project from the workspace.
- Select Project menu -> Settings.... Click on the Link tab. Change ouput file name exe to whatever you wish to call it. Add "amulet.lib" and "winmm.lib" to the end of the Object/library modules list.
- Alternatively, create a new project workspace of type Win32 Application
- Select Project menu -> Settings.... Click on the Link tab. Change ouput file name exe to whatever you wish to call it. Add "amulet.lib" and "winmm.lib" to the end of the Object/library modules list.
- To build a sample Amulet program in your own project workspace:
- Choose the "example2" Amulet sample project which demonstrates Amulet Dialog boxes and text input
- Copy the example.cc and example2db.cc files from the d:\amulet\samples\examples directory into your project workspace directory.
- Rename the ".cc" extensions to ".cpp" // (MSVC does not have a file association for the Unix ".cc" extension.
- Insert the copied example.cpp and example2db.cpp files into your project.
- Rebuild all, (compiler warnings and linker warnings will be generated).
- Execute the project to test the build.
- To add console output to your Amulet program:
- Copy the console.cpp and console.h files from the d:\amulet\src\gem directory into your project workspace directory.
- Insert the copied console.cpp file into your project.
- // no need to #include <iostream.h> into your project as console includes it.
- Rebuild all, (compiler warnings and linker warnings may be generated).
- Execute the project to test the console output.
Caveats
- Failure to call Am_Initialize(); will result in an execution error. If the Amulet console.cc (change to console.cpp) file is included as part of the project then an amulet error will be output in the console window - "**Amulet Error: ** Create called on a NULL object.
- Declare interactors after Am_Initialize(); //otherwise a startup execution error may occur.
- If you wish an interactor to affect all of the objects in a group add it after the cascading definitions of the object's parts have been defined. Call the GroupObject.Add_Part(interactor_name); member function, otherwise the interactor will only affect the previous part of the object that precedes it in the object's cascading definition.
- Do NOT define an amulet formula as menu callback function.
- When using amulet with <iostream> and the standard namespace you may get a 'cout': ambiguous symbol error. This is because the amulet header files: console.h and am_io.h both #include <iostream.h>. In this case you don't need to #include <iostream> in your code.
- If you receive the following when compiling Amulet based code: "...warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)" - include the following preprocessor compiler directive to ignore it "#pragma warning(disable:4800)".
- When converting numeric values to display in Amulet with the stringstreams, if the output is in scientific notation then you must only #include "camulet.h" header file in your Amulet code. This problem is caused by the Amulet over-loading of the iostream >> insertion operator. Including the "camulet.h" and <sstream> header files can also result in ambiguous symbol errors. The iomanip stream settings can also be turned on with the following:
osstream << fixed << showpoint << setw(4) << setprecision(2)<< FloatVar;
- If you get a "bool redefinition" error message when you compile: Go to MS VC menu Project/Settings/C/C++ panel. Look at the compiler switches in the window at the bottom of the panel. They should resemble:
/nologo /MLd /W3 /Gm /GX /ZI /Od /D "WIN32" /D NEED_BOOL /D "_DEBUG" /D
"_WINDOWS" /D "_MBCS" /Fp"Debug/<project>.pch" /YX /Fo"Debug/"
Edit the text to remove the "/D NEED_BOOL". Now exit (don't cancel) the dialog and select Build/Rebuild All.
Amulet Listservs
Multiple Amulet listservs are listed on the Amulet Web site. I would ask students NOT to join these listservs. They are for experienced Amulet users. I will be very displeased if I learn of students joining these listservs against my instructions. You will not be gaining an edge over your fellow students by doing so and I will find out. I do not wish to deal with upset Amulet listserv users and owners who do not feel that they should be subjected to the email questions of my students while they are learning Amulet. Joining the Amulet listservs against my instructions will constitute grounds for immediate removal from the CS1704 listserv (CS1704@listserv.vt.edu)! Students inundating an experienced programming listserv with beginning questions will reflect poorly on VT and myself, so be forewarned. I practice Nettiquitte and I expect my students to do so.
Students having problems with Amulet can post to the course listserv. Between fellow classmates, TAs and myself there will be plenty of help available. Be aware that the TAs and myself are learning Amulet along with you so please be patient and considerate of the suggestions and help we offer. I am sure that many of you will probably pick it up faster than we can. Students who go above the call of duty in helping out their fellow classmates in learning Amulet on the listserv will earn my thanks and a surprise reward :-)
While everyone is learning Amulet, I am temporarily suspending the listserv restriction of NOT allowing students to post source code. This will only apply to Amulet tutorial and instructional code examples. Posting of source code dealing with the course projects is still forbidden.
Open Amulet
At the Amulet Web site you will find a link to the OpenAmulet Web site. Since Government funding for Amulet has ceased, a group of programmers lead by Robert M. Muench in Germany have undertaken to continue development of Amulet. I am sure that Amulet supplies all of the programming power that we will need and since OpenAmulet is still in a state of development I would prtefer that students use Amulet.
Short code files demonstrating various Amulet features.
A discussion describing how to design the integration of Amulet interface code into an existing system.
Further Exploration (other GUI Libs)
In case anyone is interested here are a few of the other GUI libraries I considered for our use:
D. Barnette 4/12/99 |
Virginia Tech © 1995-1999 |