Rapid GUI Prototyping with Tcl/Tk 8.3
While the "cool kids" are trying to build complex GUIs in C++ with MFC or Java Swing, the greybeards are still using Tcl/Tk. Why? Because I can write a functional database admin tool in 50 lines of code while you're still waiting for your C++ compiler to finish its pre-header inclusion.
The Magic of the pack Command
Tk's layout engine is based on "packing" widgets into containers. You don't need to calculate pixel offsets; you just tell the widget which side to stick to.
# Create a simple interface
label .lbl -text "Enter Name:"
entry .ent -textvariable username
button .btn -text "Submit" -command { puts "Hello, $username" }
# Pack them in
pack .lbl -side left
pack .ent -side left -fill x -expand true
pack .btn -side right
Dynamic Behavior in a Flash
Since Tcl is a dynamic, interpreted language, you can modify the UI while it's running. You can even open a console and type commands to move buttons around in real-time.
# Add a scrollable listbox
listbox .lb -yscrollcommand ".sb set"
scrollbar .sb -command ".lb yview"
pack .sb -side right -fill y
pack .lb -side left -fill both -expand true
Cross-Platform Reality
The best part? That exact same script runs on Windows 98, Solaris, and Linux. With Tcl 8.3, the widgets even look (mostly) native on Windows. If you're building an internal tool or a quick monitoring dashboard for your server farm, stop over-engineering and start "Tk-ing."
Aunimeda builds modern web frontends - from single-page applications to complex multi-locale sites.
Contact us to discuss your frontend project. See also: Web Development, Corporate Website Development