I'm working on a progressbar and want a dynamic label on it (the label that's printed inside the progressbar indicator) but it doesn't seem to be refreshable? I've attached a variable to the progressbar, made a ticker and a button for testing which both refreshes the progressbar but nothing happens with the label.
I'm using <label>$(cat file)</label> where file is updated throughout the process with an ETA and percentage (10% - ETA: 10 minutes).
Is this possible?
PREVIOUS POST (FEEL FREE TO IGNORE):
I just came across a major bug in gtkdialog which should be easily fixed.
I'm running on a quad core processor and came across this error when I tried to insert a variable into the label of an progressbar:
[xcb] Unknown request in queue while dequeuing
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
This causes the script to crash, either with segfault or sigabort, seemingly randomly. Sometimes it even works!
Trying the same script on a single core CPU this doesn't happen.
I managed to compile the gtkdialog.c with XInitThreads but haven't managed to link the binary. Hopefully this will get fixed soon.
EDIT: I also noticed this only happens when on remote X client? Weird.
NEW: Dynamic progressbar label?
NEW: Dynamic progressbar label?
Last edited by thanius on Fri 22 May 2015, 09:09, edited 1 time in total.
Re: NEW: Dynamic progressbar label?
<label> can not be updated at runtime, only <input> and <input file> have this ability.thanius wrote:I'm working on a progressbar and want a dynamic label on it (the label that's printed inside the progressbar indicator) but it doesn't seem to be refreshable? I've attached a variable to the progressbar, made a ticker and a button for testing which both refreshes the progressbar but nothing happens with the label.
I'm using <label>$(cat file)</label> where file is updated throughout the process with an ETA and percentage (10% - ETA: 10 minutes).
Is this possible?
A working example of updatable progressbar's label can be found in official docs:
https://gtkdialog.googlecode.com/svn/tr ... ssbar_test
In a nutshell: you need to echo a value of progress as first and then the label:
Code: Select all
echo '<progressbar><input>for i in {0..100}; do echo $i; echo "Value: $i"; sleep 0.01; done</input></progressbar>' | gtkdialog -s
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]
[b][color=green]Omnia mea mecum porto.[/color][/b]