Hello! I've written kind of wrapper for ThreadNotify class, if you want to
pass a parameter(s) to the method being invoked.
Thought it might be useful for some, so I post it here. Hope you'll add it
to SVN/

using System;
using Gtk;

namespace Gtk
{
    public delegate void ParametherizedReadyEvent<T> (T param);

    public class ParametherizedThreadNotify<T>
    {
        private ThreadNotify te;
        private ParametherizedReadyEvent<T> pre;
        private T param;

        public ParametherizedThreadNotify (ParametherizedReadyEvent<T> pre)
        {
            this.pre = pre;
            this.te = new ThreadNotify (this.ReadyEvent);
        }

        private void ReadyEvent ()
        {
            this.pre (this.param);
        }

        public void WakeupMain (T param)
        {
            this.param = param;
            this.te.WakeupMain ();
        }
    }
}

It's just that simple so I just copied it from clipboard and did not upload
the file.
I've tested it, and that works.

-- 
Best regards,
Daniel Abramov aka Exception
_______________________________________________
Gtk-sharp-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Reply via email to