Create a variable "TCL" with the path where Tcl was installed (on the lab machines this is "D:\Program Files\Tcl").
d:\program files\tcl\bin\wish82.exe
Now when you debug from within MSVC (Build > Start Debug > Go, or press F5), it will start the program for you. When you run the program this way, you're also able to print messages to the MFC debug window. If you look in Impressionist.cpp you'll see a function called Debug -- this function works just like printf, but will output to MSVC. You must run your project in debug mode Build/Debug/Go (or F5) to see any output.
somewhere at the top of your impressionist.h. Note that this doesn't mean the thickness of the line is 1, it means that control #1 is going to control the thickness. We can use any number as the ID, as long as it is unique in the model.#define LINE_WIDTH 1
CreateControlMenu in impressionist.cpp is where we create the widgets. The available commands to create widgets are listed below. The first argument to each one should be the interp argument passed to CreateControlMenu; just pass it straight through.
Now, in the brush functions, we need to read the current value of the slider. Widget settings can be read with the get_control_* functions, where "*" is one of "d" (to read a double), "i" (to read an int), or "b" (to read a boolean). You pass the function the ID of the control whose value you want. Widget settings can also be changed with the set_control_* functionsscale( interp, LINE_WIDTH, "Line width", 1.0, 5.0, 1.0, 1.0 );
For example, we would get the current position of our slider with the following call:
Now when you start the program, there will be a slider added to the main window.double width = get_control_d( LINE_WIDTH);