Hello, Help me with  Invoke  in Gtk.

I have custom EventArgs and EventHandler

public class MsgEventAgrs: EventArgs
    {
        private string message;
        public string Message
        {
            get
            {
                return message;
            }
        }
        public MsgEventAgrs(string msg)
            : base()
        {
            this.message = msg;
        }
    }
    public delegate void MsgEventHandler(object sender, MsgEventAgrs mea);


And I have a class ChatClient (the class must be designed to work with every 
interface-platform, so I can not put the chat-message directly to any Gtk 
Control like TextView or Entry inside the class, instead, I must write some 
custom Event, which will be fired each time my ChatClient receives message). 
And here is some code from class ChatClient

public event MsgEventHander OnAddMessage
public void OnReceiveData(...)
{
        ....
        string msg = received message
        MsgEventArgs mea = new MsgEventArgs(msg);
        // here I must fire the event to send my message to the main 
application, which will display the message 
        Invoke(OnAddMessage, this, mea);
        
}


Of course, this Code is written in C# + WinForm. I can not find the similar 
thing in Gtk, pls help me with this problem!
Thanks in advance!
_______________________________________________
Gtk-sharp-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Reply via email to