[lazarus] Show form no modal!!

Bruno Alejandro bruno at vias.com
Mon Feb 24 17:59:06 EST 2003


Hi!!

Look, I have a form, in this form when I click new open a no modal form,
and this second form, open 3 new no modal form... this is ok, the
problem is that when I open the second form, instead to create me 1
instance of each of the 3 forms, create me 2 instances, then I have 6
forms plus the 1 I created before.

the code of the project is:

uses
  Interfaces,
  Forms, main, idebehavours, ideextensios, ideprop;

begin
  Application.Initialize;
  Application.CreateForm(TfrmFileMgr, frmFileMgr);
  Application.CreateForm(TfrmEditor, frmEditor);
  Application.CreateForm(Tfrmbehavours, frmBehavours);
  Application.CreateForm(Tfrmextensions, frmExtensions);
  Application.CreateForm(TfrmProperties, frmProperties);
  Application.Run;
end.

when I call the first form TfrmEditor I use:

procedure TfrmFileMgr.NewWindow(Sender: TObject);
var
  IDEEDT : TfrmEditor;
begin
  IDEEDT:=TFrmEditor.Create(Application);
  IDEEDT.Show;
end;

This open me 2 instances, but if I use

procedure TfrmFileMgr.NewWindow(Sender: TObject);
var
  IDEEDT : TfrmEditor;
begin
  If not Assigned(IDEEDT) then
    IDEEDT:=TFrmEditor.Create(Application);
  IDEEDT.Show;
end;

Like I used in other aplications, then it crashes, I don't know why... 

Thanks for your time...

Bruno Chavez






More information about the Lazarus mailing list