[fxruby-users] GUI Update technique

James Stallings II james.stallings at gmail.com
Tue Aug 16 09:16:22 EDT 2005

Excellent! Thanks Lyle.

I guess I have been playing my cards a bit close to my chest if I
really want any good interaction on my project.

The reasons for this are far less draconian than you might imagine: so
many good projects get started, and for what evever reason, good or
bad, get abandoned. In the end, it always makes the project owner
look, shall we say, less than dilligent.

So I'll go out on a limb here.

What I'm doing is a basic two-paned tabbook (ala the tabbook example).
In the first pane is status information about a (potential) secure
shell connection. In the second (tab) pane is a very simple dual-paned
directory listing. The one on the left, the local working directory.
The one on the right, the working directory at the far end of the
connection. Simple drag and drop will be used to indicate which set of
files will be transferred, to or from the local host.

The options to start  and manage a connection are provided via the
application menus, and all parameters for the connection are gathered
via modal dialog(s). Sensible (from a standpoint of application
startup) defaults will be provided by the application.

The idea is to leverage Net::SSH to provide a secure network file
manager that can operate with all the conveniences and security of the
SSH protocol, in combination with a simple and intuitive (well, at
least commonly known and widely understood ;)  UI provided by the Fox
GUI Toolkit.

I see the connect status pane as something that can be updated purely
by this SEL_UPDATE signal; however, the timer-based update of the
directory panes is still a neccesity as we have no way to get a signal
from the remote host when the remote working directory is updated;
polling the remote host for a new listing of the remote directory is
the obvious solution (do correct me if you think there might be a
better way :)

Thanks again Lyle!


On 8/16/05, Lyle Johnson <lyle at knology.net> wrote:
> On Aug 15, 2005, at 9:48 PM, James Stallings II wrote:
> > Is the best way to do this to create all the top-level widgets (and
> > their children) for an interface, and implement the update signals?
> > Seems then I'd be able to create all the primary widgets, let the app
> > change the values and send update signals back to the widgets and let
> > them manage repainting themselves with the new values.
> >
> > Am I on the right track? if so, can anyone toss me any gems of wisdom
> > before I try to get my head around the details?
> The GUI update feature makes sense for you if it's not a time-sensitive
> thing. (I wasn't sure based on the things you've said in recent
> e-mails.)
> Whenever there's idle time in the GUI, it (FOX) will devote some time
> to the GUI update loop, in which it sends a SEL_UPDATE message to the
> widgets (in turn). They can use that opportunity to make sure that
> their settings (e.g. a label's text, or a dial's value) accurately
> reflects the current application state, e.g.
>         viewLabel.connect(SEL_UPDATE) {
>                 viewLabel.text = modelText
>         }
> There should be some examples of this in the FXRuby examples directory.
> Now, usually this happens very quickly because there's a lot more idle
> time in a GUI application than you might realize. But if you need a
> value to change at fixed times (e.g. for a little onscreen clock or
> something) you would probably need to use a timer instead.
> Hope this helps,
> Lyle

Woulds't thou so blame
the fragrant blos'ms wilting
as never to've had her bloom?

More information about the fxruby-users mailing list