[Gtk-sharp-list] Progress Bars

Pablo Fischer pablo@pablo.com.mx
Fri, 05 Dec 2003 10:57:45 -0600


Duh.. What so stupid error :(, you were right, I was 'calling' a glade
widget that didn't exists. Sorry :)

However, now I can show and the Progress bar works.. but hey!, it
appears (and completed!) after I've made the connection!

    try {
      progress =3D new BloggyProgress();
      posts =3D client.GetLastPosts(10);
    } catch(System.Net.WebException ex) {
      dialog =3D new BloggyDialog("There was a problem connecting \n to
your blog, possible a timeout \n or trying to connect too fast");
      return false;
    }

What else can I do?, I've this in BloggyProgress:
    progress.Fraction =3D .90;
    progress.Pulse();
    progress.PulseStep =3D .10;

Thanks!
Pablo
El vie, 05-12-2003 a las 10:42, Peter Williams escribi=F3:
> Hi,
>=20
> On Fri, 2003-12-05 at 03:23, Pablo Fischer wrote:
> >   public BloggyProgress() {
> >     //Load the Glade Interface
> >     Glade.XML ui =3D new Glade.XML(null, "bloggyprogress.glade",
> > "progressbarwindow", null);
> >     //Connect it
> >     ui.Autoconnect(this);
> >     //Cast the Window
> >     progressbarwindow =3D (Gtk.Window)ui["progressbarwindow"];
> >     //And the progressbar
> >     progress =3D (Gtk.ProgressBar)ui["progress"];
>=20
> One thing here. If you have a variable in your class named
> progressbarwindow marked with the Glade.Widget attribute, like this:
>=20
> 	[Glade.Widget] Gtk.Window progressbarwindow;
>=20
> The Autoconnect function will set that variable to the appropriate
> widget. A brilliant time-saver.
>=20
> >     progress.Fraction =3D 1;
> >     //Show it..
> >     progressbarwindow.Show();
> >   }
> >=20
> > And fails If I try to use .Fraction, .Pulse or something, well it
> > compiles ok, but when I show it (the Progress) bar I get an exception:
> >=20
> > Unhandled Exception: System.NullReferenceException: A null value was
> > found where an object instance was required
> >=20
> > THIS only happens if I try to use methods or properties of a
> > progressbar.
>=20
> Are you sure progress isn't null? Maybe the name it has in the glade
> file got changed or something.
>=20
> Peter
--=20
Pablo Fischer Sandoval (pablo [arroba/at] pablo.com.mx)
http://www.pablo.com.mx
http://www.debianmexico.org
GPG FingerTip: 3D49 4CB8 8951 F2CA 8131 AF7C D1B9 1FB9 6B11 810C
Firma URL: http://www.pablo.com.mx/firmagpg.txt