Recent

Author Topic: Lazarus doesn't show components in the Form at runtime.  (Read 1101 times)

freeman

  • Newbie
  • Posts: 2
Lazarus doesn't show components in the Form at runtime.
« on: November 25, 2020, 12:34:54 pm »
Hi,
I am new. I installed Lazarus IDE on Ubuntu 20.04.1 LTS from apt package manager. IDE is working very well. I am adding the components at design time to the Form.
But when I run the application, no components appear in the form.  I am facing an empty form.

Here is the terminal output:
Code: Pascal  [Select][+][-]
  1. TLazarusManager.Run starting /home/freeman/.lazarus/bin/lazarus ...
  2. Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="/home/freeman/.lazarus"
  3. Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="/etc/lazarus"
  4. Looking for code tools config file:  "/home/freeman/.lazarus/codetoolsoptions.xml"
  5. NOTE: codetools config file not found - using defaults
  6. Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-linux-gtk2 New=x86_64-linux-gtk2 Changed: OS/CPU=True LCL=False
  7. LoadLFM Creating designer for hidden component of /home/freeman/fp/unit1.pas
  8. InitOpenedProjectFile select form in designer: Form1:TForm1 TDesigner
  9. Hint: (lazarus) [TMainIDE.DoRunProject] INIT
  10. Error: (lazarus) [TMainIDE.DoBuildProject] MainBuildBoss.DoCheckIfProjectNeedsCompilation nothing to be done
  11. [TCmdLineDebugger] Debug PID: 23642
  12. Hint: (lazarus) [TMainIDE.DoRunProject] Debugger=TGDBMIDebugger
  13. Hint: (lazarus) [TMainIDE.DoRunProject] END
  14. TGDBMIDebugger.StartDebugging WorkingDir="/home/freeman/fp/"
  15. LAZARUS END - cleaning up ...
  16. Hint: (lazarus) [TMainIDE.Destroy] B  -> inherited Destroy... TMainIDE
  17. Hint: (lazarus) [TMainIDE.Destroy] END
  18.  
  19.  


Example:
https://imgur.com/a/U8I7ekI
« Last Edit: November 25, 2020, 12:42:57 pm by freeman »

Sieben

  • Sr. Member
  • ****
  • Posts: 310
Re: Lazarus doesn't show components in the Form at runtime.
« Reply #1 on: November 25, 2020, 12:51:56 pm »
Can you close that form the conventional way then or do you have to 'kill' it? Anyway, you might want to have a look at:

https://forum.lazarus.freepascal.org/index.php/topic,35958.0.html
Lazarus 2.2.0, FPC 3.2.2, .deb install on Ubuntu Xenial 32 / Gtk2 / Unity7

freeman

  • Newbie
  • Posts: 2
Re: Lazarus doesn't show components in the Form at runtime.
« Reply #2 on: November 25, 2020, 01:01:27 pm »
I have to 'kill' it and  Project1 is not responding.  ... ... ...  Force Quit/Wait window appears automatically.

I'm looking at the thread you posted.
I will post  the result here.

Thanks.

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Lazarus doesn't show components in the Form at runtime.
« Reply #3 on: November 25, 2020, 01:45:25 pm »
Can you post your project here (use "Project->Publish project", see Sharing large pieces of code)?

That way we can test it thoroughly. I'm normally on Xubuntu 20.04 and this have never (yet, cross fingers) happened.

From your description it looks like something is preventing the form from initializing, so it never gets to the point of loading/creating the controls, but I've no idea what it might be ... unless you don't have a proper GTK setup or some libraries are missing. I kind of recall someone having this kind of problem in Ubuntu 18+
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: Lazarus doesn't show components in the Form at runtime.
« Reply #4 on: November 25, 2020, 02:04:20 pm »
I had a similar case recently: Are you sure that the resource is linked? There are two ways:
- .res resource: In this case, your form unit must contain the line {R *.lfm} after the "implementation" keyword.
- .lrs resource: In this case, your form unit must "use" the unit "LResources" and have and "initialization" section with the line {$I <unit name>.lrs}

If you cannot find any of these lines, add the {$R *.lfm} after "implemenation".

 

TinyPortal © 2005-2018