GTKdialog2 ListBox scrolls command lines like Xterm?

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

GTKdialog2 ListBox scrolls command lines like Xterm?

#1 Post by sunburnt »

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.

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#2 Post by sunburnt »

I'm not surprised that no one else has any solutions either.

How about some other "progress indicator", a linear bar or a rotating vector?
It has to be started & killed from bash code, & be GUI in nature.

I'll probably have to leave this out, but I've wanted this or similar for many apps.

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

Re: GTKdialog2 ListBox scrolls command lines like Xterm?

#3 Post by HairyWill »

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 do

Code: Select all

rxvt -e tail -f /tmp/mylog.log &
This will open a separate rxvt window that will monitor /tmp/mylog.log for changes and output them to the screen as the file grows.
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]

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#4 Post by sunburnt »

HairyWill; That's great... It does just what's needed.

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 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.

Post Reply