[Lazarus] Carbon: 10.4.11 tab key hangs on 10.5.4

EarMaster - Bent Olsen bent at earmaster.com
Wed Oct 29 12:20:10 CET 2008


There is a flaw in the code suggested below. To accomplish what you seem to want, the SHOWED_FIRST_TIME variable needs to be an instance variable rather than a local variable as declared below.

That is, the SHOWED_FIRST_TIME variable should be declared in the class definition of the form.

Using a local variable as below may work, but if so it works by chance due to the memory location the compiler is using for that local variable being static. In Delphi it would likely be a register variable, so the value would be unpredictable. The compiler would issue a hint too.

Dave Coventry rašė:
> Hi,
> 
> How can I tell when my application has loaded and I can start
> initializing some of the form elements?
> 
> At the moment I place all of the initialization routines in the
> FormCreate but quite often I get an 'external SIGSEHV' exception
as
> the mouse generates a false onSelection event on a StringGrid,
> presumably because the StringGrid has yet to be fully loaded.

  If form is non modal then I do that in OnShow event, like this:

// when form appears
procedure TfrMain.FormShow(Sender: TObject);
const
   SHOWED_FIRST_TIME: Boolean=False;
begin
     if (not SHOWED_FIRST_TIME) then begin
         SHOWED_FIRST_TIME:=True;

         // initializing

     end;
end;

-- 
   Valdas Jankūnas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20081028/f60b0e2c/attachment-0007.html>


More information about the Lazarus mailing list