Recent

Author Topic: control '' has no parent  (Read 7137 times)

toby

  • Sr. Member
  • ****
  • Posts: 275
control '' has no parent
« on: August 05, 2018, 11:56:46 pm »

added : it turns out that just running any of the lazarus - gives

'SplashForm' has no parent window

---

this happens at runtime with fpc-3.1.1 and all the lazarus-1.8.2 lazarus-1.9.0 and svn all compiled from source on a rasp pi   aarch64  - on an i386 system with fpc-3.0,4 and lazarus-1.8.2 it runs fine

Could someone please tell me what is wrong - thanks

program gg;

{$mode objfpc}{$H+}

uses interfaces, classes, forms;

type te = class(tform)
constructor create(aowner: tcomponent); override;
end;

var e : te;

constructor te.create(aowner: tcomponent);
begin
inherited createnew(aowner);
end;

begin
 
requirederivedformresource := false; // default

application.initialize;

application.createform(te, e);

application.run;

end.





« Last Edit: August 06, 2018, 12:22:27 am by toby »

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: control '' has no parent
« Reply #1 on: August 06, 2018, 12:30:21 am »
I don't see the problem. Check the attached project.
Ah different arch.

toby

  • Sr. Member
  • ****
  • Posts: 275
Re: control '' has no parent
« Reply #2 on: August 06, 2018, 02:03:10 am »
on a debian 64 bit stretch it is also fine

toby

  • Sr. Member
  • ****
  • Posts: 275
Re: control '' has no parent
« Reply #3 on: August 29, 2018, 06:06:35 pm »
Not one response to this?

No one is using lazarus on a rasp pi?  I find that hard to believe

Thaddy

  • Hero Member
  • *****
  • Posts: 18786
  • To Europe: simply sell USA bonds: dollar collapses
Re: control '' has no parent
« Reply #4 on: August 29, 2018, 06:20:50 pm »
Well, I am writing everything (almost everything) I post on this forum on a Raspberry Pi of some sort (most likely RPi3) so I will have a go...
>Gimme a few seconds...

Oh, well, works!! (Why am I not amazed?)

Is your setup current? Trunk changes by the day if not hours.

I guess there are several hundredths of the several hundredths of users that have at least one Pi or similar.
« Last Edit: August 29, 2018, 06:34:53 pm by Thaddy »
If Europe sells their USA bonds the USD will collapse. Europe can affort that given average state debts. The USA can't affort that. Just an advice...

lucamar

  • Hero Member
  • *****
  • Posts: 4217
Re: control '' has no parent
« Reply #5 on: August 29, 2018, 06:38:26 pm »
Just for curiosity: In te.create, why are you calling inherited createnew(aowner); instead of inherited create(aowner)?

Note: AFAIK it has nothing to do with your problem; I'm just wondering if I'm missing something
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.

Thaddy

  • Hero Member
  • *****
  • Posts: 18786
  • To Europe: simply sell USA bonds: dollar collapses
Re: control '' has no parent
« Reply #6 on: August 29, 2018, 06:48:45 pm »
Just for curiosity: In te.create, why are you calling inherited createnew(aowner); instead of inherited create(aowner)?

Note: AFAIK it has nothing to do with your problem; I'm just wondering if I'm missing something
He is just copying normal form instantiation: have a look at the sources....(The Lazarus sources...)
If Europe sells their USA bonds the USD will collapse. Europe can affort that given average state debts. The USA can't affort that. Just an advice...

lucamar

  • Hero Member
  • *****
  • Posts: 4217
Re: control '' has no parent
« Reply #7 on: August 29, 2018, 07:34:15 pm »
He is just copying normal form instantiation: have a look at the sources....(The Lazarus sources...)

Oh! OK, thanks!
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.

toby

  • Sr. Member
  • ****
  • Posts: 275
Re: control '' has no parent
« Reply #8 on: August 29, 2018, 10:39:31 pm »
thank you for responding (a little needling always helps to get help :)

if i use  inherited create(aowner);
instead of inherited createnew(aowner);
i get
Form resource te not found. For resourceless forms CreateNew constructor must be used. See the global variable RequireDerivedFormResource.

I have the exact setup on the rpi3b as on all my computers
compiled fpc-svn from fpc-3.0.4 and then compiled lazarus-svn
aggpas and fpgui all work

the only thing i can see different is that i am doing lazarus through vnc rather then directly on a hdmi tv

i don't have access to a hdmi tv any more so i can't test

lucamar

  • Hero Member
  • *****
  • Posts: 4217
Re: control '' has no parent
« Reply #9 on: August 29, 2018, 11:54:19 pm »
if i use  inherited create(aowner);
instead of inherited createnew(aowner);
i get
Form resource te not found. For resourceless forms CreateNew constructor must be used. See the global variable RequireDerivedFormResource.

Yeah, thanks. I finally dived into the source and saw the whys and why-nots  :)
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.

jamie

  • Hero Member
  • *****
  • Posts: 7601
Re: control '' has no parent
« Reply #10 on: August 30, 2018, 02:15:55 am »
This is how I do a splash screen..
The Form is designed at Design time and I have extra processing that needs to happen at
runtime "MakeSplash"

Code: Pascal  [Select][+][-]
  1.     Application.Initialize;
  2.     Application.HelpFile := 'XXXXXX';
  3.     try
  4.       SplashAbout := TSplash.Create(nil);
  5.       SplashABout.MakeSplash;
  6.       Sleep(2000);
  7.       SplashAbout.Free;
  8.       Application.CreateForm(TForm1, Form1);      
  9.      ……...
  10.  
The only true wisdom is knowing you know nothing

Thaddy

  • Hero Member
  • *****
  • Posts: 18786
  • To Europe: simply sell USA bonds: dollar collapses
Re: control '' has no parent
« Reply #11 on: August 30, 2018, 07:20:39 am »
i don't have access to a hdmi tv any more so i can't test
Are you sure in that case that the X11 subsystem is actually running?
(startx)

If I use VNC I still have the same output as my screenshot. And that is with the code you provided yourself as you can also see from the screenshot.
If Europe sells their USA bonds the USD will collapse. Europe can affort that given average state debts. The USA can't affort that. Just an advice...

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: control '' has no parent
« Reply #12 on: August 30, 2018, 07:22:40 am »
i don't have access to a hdmi tv any more so i can't test
Are you sure in that case that the X11 subsystem is actually running?
(startx)

If I use VNC I still have the same output as my screenshot. And that is with the code you provided yourself as you can also see from the screenshot.
just a thought but, without X11 does lazarus load at all?
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Thaddy

  • Hero Member
  • *****
  • Posts: 18786
  • To Europe: simply sell USA bonds: dollar collapses
Re: control '' has no parent
« Reply #13 on: August 30, 2018, 07:34:28 am »
No, of course not. But here I understood he simply tried to run a Lazarus compiled executable.
Don't get confused by my screenshot: that's one of my Raspberry Pi 3's running Lazarus 1.9 and his code, not just the compiled code.
Hence my remark: if X is not running a Lazarus compiled GUI app will not run: and indeed that error message can pop-up since there is no parent at all.
Then again, with VNC he can tell if he gets the desktop instead of a console.  I just quickly tested with RealVNC on my mobile phone and I get the desktop. With or without monitor connected to the Pi.

Strange that his code - ad verbatum, without any changes except the program name- simply runs on my Pi's and not on his... Can't be the program name... O:-) 8-)
« Last Edit: August 30, 2018, 07:43:55 am by Thaddy »
If Europe sells their USA bonds the USD will collapse. Europe can affort that given average state debts. The USA can't affort that. Just an advice...

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: control '' has no parent
« Reply #14 on: August 30, 2018, 08:15:53 am »
No, of course not. But here I understood he simply tried to run a Lazarus compiled executable.
this happens at runtime with fpc-3.1.1 and all the lazarus-1.8.2 lazarus-1.9.0 and svn all compiled from source on a rasp pi   aarch64  - on an i386 system with fpc-3.0,4 and lazarus-1.8.2 it runs fine
I assume that the line above means that he compiles on arasp pi using lazarus.
Don't get confused by my screenshot: that's one of my Raspberry Pi 3's running Lazarus 1.9 and his code, not just the compiled code.
Hence my remark: if X is not running a Lazarus compiled GUI app will not run: and indeed that error message can pop-up since there is no parent at all.
Then again, with VNC he can tell if he gets the desktop instead of a console.  I just quickly tested with RealVNC on my mobile phone and I get the desktop. With or without monitor connected to the Pi.

Strange that his code - ad verbatum, without any changes except the program name- simply runs on my Pi's and not on his... Can't be the program name... O:-) 8-)
I guess he has not shared the problematic code yet. The complete thread looks like an exercise in futility to me.

Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

 

TinyPortal © 2005-2018