I’m working on a task tracking program for my job. It is modified from stopwatch.
It’s basic function is to visually keep track of the time each task takes, record it into a text file and zero the clock. Here is a screenshot of the program as it sits now.
The buttons and labels are placed using grid like so:
grid .laplabel .laptime .laprecord .lapzero
grid configure .laplabel -sticky e
grid configure .laptime -sticky ns
grid .lap2label .lap2time .lap2record .lap2zero
grid configure .lap2label -sticky e
grid configure .lap2time -sticky ns
grid .lap3label .lap3time .lap3record .lap3zero
etc…
Each press of the record button invokes .laprecord and .lapzero like so:
button .laprecord -text "record" -command {
record L TEST$time(lap)
set time(lap) [timeformat 0]
set time(lstart) [now]
}
proc lapzr {} {
.laprecord invoke
.lapzero invoke
}
So, the gui is becoming unwieldy with even the twelve entries now present, and I have approximately fifteen more to add. What I envision is that all of the entries which are now arranged using grid will be instead arranged into a single drop down menu.
Any advice on how to accomplish this would be much appreciated.
Try using a tktable. It appears to be designed for this sort of tabular data, and IIRC it can be bound to an array so inserting more rows should be simple.