System.Timer, Thread and notification icon.

View: New views
3 Messages — Rating Filter:   Alert me  

System.Timer, Thread and notification icon.

by lordphoenix-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

signature.asc (204 bytes) Download Attachment

Re: System.Timer, Thread and notification icon.

by Andy Selvig :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...> 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@...
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>
_______________________________________________
Gtk-sharp-list maillist  -  Gtk-sharp-list@...
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Re: System.Timer, Thread and notification icon.

by M.Mushiba :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hello.

I couldn't help but notice you are developing a application that works with a web application.
I have to develop something similar with my skill level. Im rather new at programming but what I basically wanted to write is a notification system. The system will consist of a web site where users can add notifications and a desktop application that reads the notices from an online website. Im considering using threads to read the INI from the sql online database. Do you have any idea whether something like this has been done and where I can look for source code, also can you make any suggestions as to how I can implement this system.

Thanks alot
Mushiba