2

I did a checkout of d-gecko SDK from sf.net ( http://sourceforge.net/projects/d-gecko/ ). I wanted to try it with Gecko (XULRunner) 1.9, however when running simple application each time I get error in stdcall function, pointing to WebBrowser.Paint line ... My question is - did anyone succeeded to run GeckoSDK Delphi app in XULRunner 1.9? If so - how? Did it worked out-of-the-box for you?

Thanks m.

ulrichb
  • 19,610
  • 8
  • 73
  • 87
migajek
  • 8,524
  • 15
  • 77
  • 116

2 Answers2

1

I had also this problem. I just neutralized baseWin.Repaint(True);
Il all worked perfectly afterward

procedure TCustomGeckoBrowser.Paint;
var
  rc: TRect;
  baseWin: nsIBaseWindow;
begin
  if csDesigning in ComponentState then
  begin
    rc := ClientRect;
    Canvas.FillRect(rc);
  end else
  begin
    baseWin := FWebBrowser as nsIBaseWindow;
    //baseWin.Repaint(True);
  end;
  inherited;
end;
  • did it really worked for you? I tried commenting it out but I ended up with "not-painted" area instead of web page ... [which is quite obvious] oh, BTW assigning baseWin here doesn't make any sense I guess? ... – migajek Feb 26 '10 at 19:20
1

You need to navigate somewhere before the webbrowser first attempts to paint itself. So, LoadURI() must be called before the component is visible.

Easiest solution: Call LoadURI('about:blank') before the component is visible.

NineBerry
  • 26,306
  • 3
  • 62
  • 93