NEW: Dynamic progressbar label?

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
thanius
Posts: 10
Joined: Tue 04 Feb 2014, 17:19

NEW: Dynamic progressbar label?

#1 Post by thanius »

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.
Last edited by thanius on Fri 22 May 2015, 09:09, edited 1 time in total.

thanius
Posts: 10
Joined: Tue 04 Feb 2014, 17:19

#2 Post by thanius »

bump

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

Re: NEW: Dynamic progressbar label?

#3 Post by SFR »

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?
<label> can not be updated at runtime, only <input> and <input file> have this ability.

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
Greetings!
[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]

Post Reply