I'd like to have a popup GTK ListBox (or Xdialog) scroll a list entered line by line.
This list could be dirs. and/or files being copied, deleted, etc., or anything.
The RAR file SFX installer & some game installers do this sort of thing.
The Listbox is filled from a file, add a line to the file & refresh the ListBox.
But I can't see how to refresh a GTK ListBox by an external event.
It seems only widgets internal to the GTK code can have <action> events.
I can't even think of a way to feed commands to Xterm to do the same thing.
Xterm would have to be started from code, & then fed echo lines from code.
While being somewhat of an overkill, this would work for the purpose.
This isn't critical... But it's something I've thought about for awhile now.
GTKdialog2 ListBox scrolls command lines like Xterm?
Re: GTKdialog2 ListBox scrolls command lines like Xterm?
Two ideas.
Rather than expecting an external event to trigger the update to the listbox is it not possible to poll a file for new lines and then update the listbox.
I've never done any GTK programming so I'm not sure if this even makes sense, does the GTK window block code execution until it is closed.
A solution using rxvt would be to doThis will open a separate rxvt window that will monitor /tmp/mylog.log for changes and output them to the screen as the file grows.
Rather than expecting an external event to trigger the update to the listbox is it not possible to poll a file for new lines and then update the listbox.
I've never done any GTK programming so I'm not sure if this even makes sense, does the GTK window block code execution until it is closed.
A solution using rxvt would be to do
Code: Select all
rxvt -e tail -f /tmp/mylog.log &
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
HairyWill; That's great... It does just what's needed.
For GTKdialog, here's code for a simple ListBox & buttons to demonstrate:
You can highlight this code & then middle click in xterm to run it.
You can see the Button part: "<action>refresh:sfsFiles</action>" that reloads the ListBox.
But I know of no way to "refresh" the ListBox from an external event.
But your code to use xterm for it is all that's really needed to do the job.
Many thanks... Terry B.
For GTKdialog, here's code for a simple ListBox & buttons to demonstrate:
Code: Select all
#!/bin/sh
export Boot_Man="
<wtitle> Full-HD: SFS file Installer</wtitle>
<frame >
<vbox>
<list><variable>sfsFiles</variable><label>. SFS files that are Installed. </label>
<input>cat /root/my-applications/sfsInstaller_full-HD/sfslist</input></list>
<hbox>
<button><label>Install SFS file</label><action>./sfsinstaller install 0</action>
<action clear>sfsFiles</action><action>refresh:sfsFiles</action></button>
<button><label>UnInstall SFS file</label><action>./sfsinstaller uninstall \$sfsFiles</action>
<action clear>sfsFiles</action><action>refresh:sfsFiles</action></button>
<button cancel></button>
</hbox>
</vbox>
</frame>
"
gtkdialog2 --program=Boot_Man
You can see the Button part: "<action>refresh:sfsFiles</action>" that reloads the ListBox.
But I know of no way to "refresh" the ListBox from an external event.
But your code to use xterm for it is all that's really needed to do the job.
Many thanks... Terry B.