Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 24 Apr 2018, 19:17
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
NEW: Dynamic progressbar label?
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [3 Posts]  
Author Message
thanius

Joined: 04 Feb 2014
Posts: 10

PostPosted: Thu 21 May 2015, 03:59    Post subject:  NEW: Dynamic progressbar label?
Subject description: WAS: Major bug in Gtkdialog - No threading support!
 

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, 05:09; edited 1 time in total
Back to top
View user's profile Send private message 
thanius

Joined: 04 Feb 2014
Posts: 10

PostPosted: Fri 22 May 2015, 05:08    Post subject:  

bump
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1655

PostPosted: Fri 22 May 2015, 05:42    Post subject: Re: NEW: Dynamic progressbar label?
Subject description: WAS: Major bug in Gtkdialog - No threading support!
 

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/trunk/examples/progressbar/progressbar_test

In a nutshell: you need to echo a value of progress as first and then the label:
Code:
echo '<progressbar><input>for i in {0..100}; do echo $i; echo "Value: $i"; sleep 0.01; done</input></progressbar>' | gtkdialog -s

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [3 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0297s ][ Queries: 11 (0.0047s) ][ GZIP on ]