Mono.WebKit.WebBrowser.Load C# (CSharp) Method

Load() public method

Initialize a browser instance.
public Load ( IntPtr handle, int width, int height ) : bool
handle System.IntPtr /// A to the native window handle of the widget /// where the browser engine will draw ///
width int /// A . Initial width ///
height int /// A . Initial height ///
return bool
        public bool Load(IntPtr handle, int width, int height)
        {
            this.handle = handle;
            this.width = width;
            this.height = height;

            System.Threading.ThreadStart start = delegate () {
                lock (widgetLock) {
                    if (!GLib.Thread.Supported)
                        GLib.Thread.Init ();
                    Gdk.Threads.Init ();
                    Gtk.Application.Init ();
                    started = true;
                }
                Gtk.Application.Run ();
            };

            lock (initLock) {
                if (!started) {
                    System.Threading.Thread t = new System.Threading.Thread (start);
                    t.Start ();
                }
            }

            while (!initialized) {
                lock (widgetLock) {
                    if (!started)
                        continue;
                    Gdk.Threads.Enter ();
                    InitializeWindow (null, null);
                    Gdk.Threads.Leave ();
                    widgetCount++;
                }
            }
            //			Gdk.Window.DebugUpdates  = true;
            return true;
        }