Where is the entry point to graphical application lazarus / 39-Graphics ---------------------------------------------------------------------- no_shaking · 2014-05-07 12:43 I have developed a graphical application which uses a TTimer object. However, the TTimer procedure acts as the entry point into my application. I wish to know what calls this procedure; TGraphicalForm.Timer1Timer(Sender: TObject); begin end; I would like to do the following Procedure runGraphicalSimulation() begin    Dosomething();    while ExitProgram = false do    begin        ProcinitialseVars();        ProcSetBasevalues();        TGraphicalForm.Timer1Timer(Sender: TObject);     end;    TidyUp(); end; ---------------------------------------------------------------------- Leledumbo · 2014-05-07 14:54 Welcome to event driven programming world. Actually, I'm a bit confused with what you want, but I'll just explain how TTimer works. Once you set Interval property and then set Enabled property to true, a native widgetset timer is created. Usually, this is internally implemented as a thread. The interval is then copied and and decremented until it reaches 0, that's when TTimer.OnTimer is called. The process is repeated as long as Enabled = true. ---------------------------------------------------------------------- Martin_fr · 2014-05-07 15:02 Menu "Project" > "Show Project Source" It calls Application.ProcessMessages. That is the closest to that loop. The actual "loop" is in the OS. That is ProcessMessagces IIRC is a loop, but it does not call all the events, it calls the OS, and the OS calls the event. It also depends, on if it is Windows, or gtk, or qt. ---------------------------------------------------------------------- User137 · 2014-05-07 16:21 Is this what you mean, how to call an event procedure? Code: [Select]Timer1Timer(nil);It expects a TObject parameter so it could be nil, or just aswell Timer1Timer(Timer1);