[lazarus] Application.MainForm

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Sep 16 03:42:12 EDT 2003


On Tue, 16 Sep 2003 13:12:50 +1000
SteveG <steveg at nevets.com.au> wrote:

> Is it possible to use the OnIdle event without a form?

Yes. You just need an object for the method.
But why do you want an application without a form?


> Can I create a routine to be called once the app reaches idle / ready 
> state ?

Easiest way:

Create a Form1Create and add the code
Application.OnIdle:=
Keep the cursor after the := operator and press Shift-Ctrl-C for code
completion. In the new method you can do whatever needed. For example
setting Application.OnIdle to nil, so that your method is called only once.


Mattias


> 
> Mattias Gaertner wrote:
> > On Tue, 16 Sep 2003 05:05:20 +1000
> > SteveG <steveg at nevets.com.au> wrote:
> > 
> > 
> >>2 Questions -
> >>
> >>1 - Using Assigned(Application.MainForm) tells me True/False, but how do
> >
> >>     I wait till finished creating if False? 
> > 
> > 
> > After the form has finished loading, the Form1.OnCreate event is called.
> > This does not mean, that all handles are fully created (theme, window
> > sizes and positions). When this will happen depends on the interface and
> > your windowmanager.
> > If you want to react, when everything is loaded and the application is
> > ready to run, use the Application.OnIdle event.
> 
> _________________________________________________________________
>      To unsubscribe: mail lazarus-request at miraclec.com with
>                 "unsubscribe" as the Subject
>    archives at http://www.lazarus.freepascal.org/mailarchives


-- 






More information about the Lazarus mailing list