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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Björn Steinbrink <B.Steinbrink@xxxxxx>
---
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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux