Resources » Controlling devices with the serial port and writing graphical interfaces »5. Adding a GUI with Tcl/TkTcl/Tk is the most convenient way to create GUIs that will work on both Windows and Linux. Even if you only use one system, you will benefit from the fact that Tcl/Tk is quite easy to learn and used by a lot of people. The particular mix of Tcl/Tk and C that we recommend here was the best solution we found; if you know of other ways to do it, let us know! Now, take a look at
scale .servo$i.scale -width 20 -length 200 -orient vertical
-from 500 -to 5500 -command "stepTo 0 $i " -showvalue 0
This creates a slider with values from 500 to 5500, so that whenever you adjust the slider, the command stepTo 0 slider position will be run, with slider and position replaced by
the slider number and position. This command is defined in Tcl_CreateObjCommand(interp, "stepTo", &stepToProc, NULL, NULL); The arguments are interpreted by the C function
|
|
Log In
|
Wish Lists
|
BIG Order Form
|
Shopping Cart
US toll free: 1-877-7-POLOLU ~
(702) 262-6648 |
|||||||||||||
| Catalog | Forum | Resources | Distributors | Ordering | About | Contact | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|