[Gtk-sharp-list] System.Timer, Thread and notification icon.

Andy Selvig ajselvig at gmail.com
Tue May 19 16:47:12 EDT 2009


Have a look at this article for all sorts of information about using
threads with Gtk#.

http://mono-project.com/Responsive_Applications

Basically, you want to use Gtk.Application.Invoke to make calls to the
GUI thread from a different thread, like:

Gtk.Application.Invoke (delegate {
              // do something to a gui object here
});



On Tue, May 19, 2009 at 3:25 PM, lordphoenix <lordphoenix at free.fr> wrote:
>
> Hi all,
> I'm working on an notification application as client for a web
> application. I'm using System.Timer to make verification at precise
> interval. I would like to change notification icon according to result
> of verification but I've some thread problem when I try to get acess to
> interface element from Elapsed method of Timer.
> According to MSDN documentation I must put an element of interface in
> property SynchronizingObject of timer. They give WindowsForm as example
> but of course I don't have one as I'm using Gtk.
>
> So I really don't know what to do if someone could have any idea it
> would be helpful.
> If you want see the code you will find it here
> http://svn.codingteam.net/ttnotify/trunk/tt-notify/Main.cs
>
> PS : Sorry for my bad English I'm French and I don't speak it very
> often.
>
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>


More information about the Gtk-sharp-list mailing list