[Gtk-sharp-list] I really need some sort of tutorial

Adam Tauno Williams adam at morrison-ind.com
Mon Jun 2 10:35:37 EDT 2008

> on interactive applications.
> I don't have any previous experience with using GTK in C or C++.

I came to GTK# from the same place so don't feel too bad.  Last time I'd
done any GUI programming was with Borland's OWL toolkit on Windows For
Workgroups.  :)

> Basically, there are a lot of fields (you can see an image at
> http://quarter-flash.com/powerball.png) and the [Play] button kicks
> off either a thread or just starts the loop that starts running the
> program.
> Because the actual code for updating fields is part of a separate
> class (separate from the GUI) I am not seeing the UI update at all.

I assume your Window / Dialog with the form fields is a class?  Just
expose the fields as properties might be the simplest way.

public string Jackpot { set { jackpot.Text = value; } }

That should update the value in the field.  Have your command class call
that method of your Window/Dialog/Form class.

> I have seen a lot of very simple tutorials on how to make a GUI
> responsive, but I'm not seeing two way communications happening. That
> is, I need to grab values from the text entry fields, process them,
> and then update the text entry fields with the new values.
> I'm most likely just being very dense here, and I'm finding it very
> difficult to wrap my mind around how this works. I think I understand
> that if the user was editing the fields I could attach callbacks for
> the fields, but since it's the program editing the fields I'm just not
> making the connection (literally :) in how this works.

You can either update the field whenever the value is changed by the
calculation or call a Timer to refresh the values from the command

> The interface was designed in Glade and perhaps there are some
> properties there that I've set incorrectly that are hindering my attempts.
> Any pointers/references that you can point me to would be *greatly*
> appreciated.
          Consonance: an Open Source .NET OpenGroupware client.
 Contact:awilliam at whitemiceconsulting.com   http://freshmeat.net/projects/consonance/

More information about the Gtk-sharp-list mailing list