views:

525

answers:

2

Hi, 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.

+1  A: 

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;
Anil CASSAM CHENAI
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
+1  A: 

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
thank you!! :) it works! :)
migajek