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 Wed 16 Apr 2014, 21:17
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
How to use a GTK horizontal scroll bar for a progress bar?
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [5 Posts]  
Author Message
sunburnt


Joined: 08 Jun 2005
Posts: 4979
Location: Arizona, U.S.A.

PostPosted: Mon 12 Oct 2009, 02:22    Post subject:  How to use a GTK horizontal scroll bar for a progress bar?  

I wrote a script to track the percent of a file that has been copied.
Now I need a graphical display, a horizontal scroll bar is the easiest way.
I need the scroll bar to popup and it`s position controlled by my script.

I`ve looked at GTK before and couldn`t make any sense of it.
I couldn`t get anything to work in GTK from a Bash script.
This will be a good way to begin my understanding of how to use GTK.

In Visual Basic this is a snap to do, I would even make an ActiveX of it.
Back to top
View user's profile Send private message 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Mon 12 Oct 2009, 08:33    Post subject:  

Code:
#!/bin/bash

percent=0
(
while test $percent != 110
do
echo $percent
percent=`expr $percent + 10`
sleep 1
done
) |
Xdialog --title "Gauge works!" --gauge "This is how a gauge appears on the command line" 10 60 0


greets, Mark (currently 1 week in holiday, so not posting much)

_________________
my recommended links
Back to top
View user's profile Send private message Visit poster's website 
Pizzasgood


Joined: 04 May 2005
Posts: 6270
Location: Knoxville, TN, USA

PostPosted: Tue 13 Oct 2009, 00:35    Post subject:  

Just a small point: that works fine as a script, but if you wanted to actually type those commands into the terminal and run it that way, the string with the exclamation mark in it would need to use single-quotes rather than double-quotes (or be omitted). Otherwise it gives an error.

Works fine as a script though.

_________________
Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

Back to top
View user's profile Send private message Visit poster's website 
sunburnt


Joined: 08 Jun 2005
Posts: 4979
Location: Arizona, U.S.A.

PostPosted: Tue 13 Oct 2009, 17:06    Post subject:  

Thanks Pizzasgood; Man this is a cool forum... I love it!

MU; I completely forgot about the xDialog gauge control.
I didn`t think there was one... Got a nice CL copy working with a GUI.

Now I`m thinking a full blown file browser like WinExplorer.
So I`m looking at gtkDialog controls and I can`t see how the tree works.
It has sub nodes, but I don`t see how they`re controlled, really odd...
xDialogs treeview is easy to control, it`s a little weird but that`s xDialog.
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 4979
Location: Arizona, U.S.A.

PostPosted: Tue 13 Oct 2009, 17:17    Post subject:  

Seems that the gtkDialog-2 tree sub branches the item if it`s the same as the last item.
But it does not seem to have any method of control over the branch`s structure.
The original tree_multicolumn control has 2 levels of branches.
But if I modify it then there`s only 2 levels, really odd...

I asked zigbert and he didn`t know... Any ideas anyone???
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [5 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.0551s ][ Queries: 12 (0.0175s) ][ GZIP on ]