Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2003-09

Application.MainForm

9 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mattias Gaertner
to SteveG: 2 Questions - 1 - Using Assigned(Application.MainForm) tells me True/False, but how do I…
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.

Show quoted text 5 lines
- Using Application.ProcessMessages causes errors until Form created. 2 - Is it possible to access the TApplication data of another application if I have a pointer to it? (or is this not doable in Linux)

No. Pointer has only meaning to one process, including its threads/forks.

Mattias

Reply by email

Mattias Gaertner
to SteveG: 2 Questions - 1 - Using Assigned(Application.MainForm) tells me True/False, but how do I…
> But why do you want an application without a form? Daemons, cgi, filters, embedded machine control apps...

Speaking on a lazarus list, I ment with "application" a LCL TApplication, aka gui.
See Sebastian's mail.

Show quoted text 7 lines
Speaking of cgi, does anyone have a copy of Robert Hiltibidal's PasWeb unit? The link to it has been dead on the FreePascal site for the last few weeks: http://rmh.fgi.net http://www.freepascal.org/contrib/db.php3?category=Internet

dont know

Mattias

Reply by email

Mattias Gaertner
to SteveG: 2 Questions - 1 - Using Assigned(Application.MainForm) tells me True/False, but how do I…
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

Show quoted text 24 lines
Mattias Gaertner wrote: > On Tue, 16 Sep 2003 05:05:20 +1000 > SteveG 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 with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives

Reply by email

SteveG
to SteveG: 2 Questions - 1 - Using Assigned(Application.MainForm) tells me True/False, but how do I…

Thanks Mattias - works fine
I needed to access the application info without direct usage of a form (tho it is a gui app) as my code is within a library, and shared with many other modules (apps). This cuts down the individual coding per app to be done (all done within the library)

Mattias Gaertner wrote 34 lines
On 16 Sep 2003 15:28:07 -0600 Tom Lisjac wrote: >>But why do you want an application without a form? > >Daemons, cgi, filters, embedded machine control apps... Speaking on a lazarus list, I ment with "application" a LCL TApplication, aka gui. See Sebastian's mail. >Speaking of cgi, does anyone have a copy of Robert Hiltibidal's PasWeb >unit? The link to it has been dead on the FreePascal site for the last >few weeks: > >http://rmh.fgi.net > >http://www.freepascal.org/contrib/db.php3?category=Internet dont know Mattias _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives

Reply by email

SteveG

2 Questions -

1 - Using Assigned(Application.MainForm) tells me True/False, but how do I wait till finished creating if False? - Using
Application.ProcessMessages causes errors until Form created.

2 - Is it possible to access the TApplication data of another application if I have a pointer to it? (or is this not doable in Linux)

Thanks

Reply by email

SteveG
to SteveG: 2 Questions - 1 - Using Assigned(Application.MainForm) tells me True/False, but how do I…

Is it possible to use the OnIdle event without a form? Can I create a routine to be called once the app reaches idle / ready state ?

Mattias Gaertner wrote 16 lines
On Tue, 16 Sep 2003 05:05:20 +1000 SteveG 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.

Reply by email