| Author |
Message |
sunburnt

Joined: 08 Jun 2005 Posts: 4006 Location: Arizona, U.S.A.
|
Posted: 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
|
|
 |
MU

Joined: 24 Aug 2005 Posts: 13642 Location: Karlsruhe, Germany
|
Posted: 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
|
|
 |
Pizzasgood

Joined: 04 May 2005 Posts: 6270 Location: Knoxville, TN, USA
|
Posted: 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
|
|
 |
sunburnt

Joined: 08 Jun 2005 Posts: 4006 Location: Arizona, U.S.A.
|
Posted: 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
|
|
 |
sunburnt

Joined: 08 Jun 2005 Posts: 4006 Location: Arizona, U.S.A.
|
Posted: 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
|
|
 |
|