[Mono-list] graphical wrap

Jonathan Pryor jonpryor@vt.edu
Sat, 22 May 2004 15:33:58 -0400

On Sat, 2004-05-22 at 12:21, Fred Blaise wrote:
> Thank you Jon. This is the route I started to take, but i very quickly
> realized that I would have pb with the progress bar... I won't be able
> to just take the standard streams (input, output) to show on my gui
> interface.

Why not?  `wget' takes a --progress=TYPE parameter, and --progress=dot
looks like it would be fairly amenable to parsing.  Just interpret the
standard error stream (why's wget spit output to stderr?!), updating the
Gtk# progress bar as you go along.

The one downside is that reading from wget's standard error stream will
hang the thread doing the read, so you'd likely want to use a second
thread to interpret wget's output, and use GLib.Timeout.Add to add a
handler which updates the progress bar from the main thread.

Check the gtk-sharp-list archives for more information.

 - Jon

> Does wget has an interface I could use? Or would I basically have to
> take wget apart in order to make that gui?
> Thanks.
> ...chap
> On Sat, 2004-05-22 at 10:45, Jonathan Pryor wrote:
> > On Wed, 2004-05-19 at 01:51, Fred Blaise wrote:
> > > I would like to create a basic GUI for wget. That would push me to use
> > > many widgets :) My question is: what is the best way to interact with
> > > the command line program from my GUI application?
> > 
> > You might try looking at System.Diagnostics.Process, which allows you to
> > launch a new process with arbitrary arguments and interact with it's
> > standard input, output, and error streams.
> > 
> >  - Jon
> > 
> > 
> > _______________________________________________
> > Mono-list maillist  -  Mono-list@lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-list