The time now is Tue 18 Jun 2013, 18:38
All times are UTC - 4 |
| Author |
Message |
brokenman
Joined: 20 Oct 2011 Posts: 15
|
Posted: Sun 04 Dec 2011, 21:18 Post_subject:
How to create a tailbox with gtkdialog? |
|
I am having trouble understanding how to create a tailbox using gtkdialog.
At the moment i have a working example using xdialog but i am unsure if i should be using a progressbox that refreshes the editbox, or the timer fucntion i read about. Any help would be appreciated ... here is my example using xdialog:
| Code: | ( rsync_command >> $WRK/.rsyncstream & ) 2>> $WRK/.rsyncstream
while [[ -f $WRK/rsync-lock ]]; do
Xdialog --title "Syncing with slackbuilds $sbver" --backtitle "When syncing is complete, click OK!" --no-cancel --tailbox $WRK/.rsyncstream 600x460
done |
This (rsync_command function) streams the output of my rsync command into a file that is read by the tailbox. how can i accomplish the same using gtkdialog?
|
|
Back to top
|
|
 |
sunburnt

Joined: 08 Jun 2005 Posts: 4015 Location: Arizona, U.S.A.
|
Posted: Tue 06 Dec 2011, 00:54 Post_subject:
|
|
The problem I`ve always run into is that gtkDialog can`t be refreshed by external code.
A gtkDialog GUI loads the widgets at startup, then only widgets can refresh widgets.
If there is a timer, then it should do the trick, but I`ve never used it.
# Suggestion: You might make your TailBox with BaCon.
I know it is capable of doing what you want.
And... It will work on any Linux distro. with C ( virtually all...).
# Puppy is one of the few Linux distros. I`ve seen that uses gtkDialog.
|
|
Back to top
|
|
 |
thunor

Joined: 14 Oct 2010 Posts: 344 Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
|
Posted: Tue 06 Dec 2011, 11:12 Post_subject:
Re: How to create a tailbox with gtkdialog? |
|
| brokenman wrote: | I am having trouble understanding how to create a tailbox using gtkdialog.
At the moment i have a working example using xdialog but i am unsure if i should be using a progressbox that refreshes the editbox, or the timer fucntion i read about. Any help would be appreciated ...
... |
Hi brokenman
| Code: | #!/bin/sh
GTKDIALOG=gtkdialog
DIALOG_MAIN='
<window title="Syncing with slackbuilds '$sbver'" resizable="true"
default-width="600" default-height="460">
<vbox>
<text label="When syncing is complete, click OK!"></text>
<vbox scrollable="true">
<text wrap="false">
<variable>txtOutput</variable>
<input>tail -n 20 '$WRK'/.rsyncstream</input>
</text>
</vbox>
<hbox homogeneous="true">
<button use-stock="true" label="gtk-ok" is-focus="true"
width-request="90">
</button>
</hbox>
<timer interval="2" visible="false">
<action>refresh:txtOutput</action>
</timer>
</vbox>
<action signal="hide">exit:Exit</action>
</window>
'
export DIALOG_MAIN
$GTKDIALOG --program=DIALOG_MAIN
|
Regards,
Thunor
|
|
Back to top
|
|
 |
brokenman
Joined: 20 Oct 2011 Posts: 15
|
Posted: Tue 06 Dec 2011, 16:20 Post_subject:
Tailbox resolved |
|
Thank you kindly Thunor, you are a scholar and a gentleman and freakin awesome!
This is a much more elegant solution than my hidden progress bar repeatedly refreshing.
I have added you to my my list of favourite deities.
|
|
Back to top
|
|
 |
|
|
|
Rules_post_cannot Rules_reply_cannot Rules_edit_cannot Rules_delete_cannot Rules_vote_cannot You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|
[ Time: 0.0442s ][ Queries: 11 (0.0042s) ][ GZIP on ] |