git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] GUI: Add a progressbar to visualize the time that is left

From
Björn Steinbrink <b.steinbrink@gmx.de>
Date
Oct 1, 2008, 21:09 UTC
Message-ID
<20081001210901.GA5731@atjola.homenet>
In-Reply-To
<alpine.LFD.2.00.0810011240390.3575@nehalem.linux-foundation.org>
Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
---
OK, this bar doesn't fill up as you requested, but instead gets empty,
that's just how I feel it should be ;-)
Might require Tcl/Tk 8.5...
 tracker-ui.tcl |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/tracker-ui.tcl b/tracker-ui.tcl
index 16d00d7..5314c57 100755
--- a/tracker-ui.tcl
+++ b/tracker-ui.tcl
@@ -8,6 +8,7 @@ proc every {ms body} {
 set user $env(USER)
 
 pack [label .tracker -textvariable time]
+pack [ttk::progressbar .bar]
 
 every 1000 {
 	global user
@@ -17,4 +18,9 @@ every 1000 {
 	gets $f l3
 	close $f
 	set ::time "$l3"
+	set times [split "$l1" " "]
+	set max [lindex $times 0]
+	set cur [lindex $times 1]
+	set left [expr $max - $cur]
+	.bar configure -max $max -value $left
 }
-- 
1.6.0.2.307.gc427
Previous: Mikael Magnusson
Message 10 of 10 in “Help with a tcl/tk gui thing..”
  1. Linus TorvaldsOct 1, 2008
  2. Change color at specified thresholdJohannes Schindelin, Oct 1, 2008
  3. Make maximum surf time really per dayJohannes Schindelin, Oct 1, 2008
  4. Linus TorvaldsOct 1, 2008
  5. Mikael MagnussonOct 1, 2008
  6. Linus TorvaldsOct 1, 2008
  7. Mikael MagnussonOct 2, 2008
  8. Linus TorvaldsOct 2, 2008
  9. Mikael MagnussonOct 2, 2008
  10. GUI: Add a progressbar to visualize the time that is leftBjörn Steinbrink, Oct 1, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.