Sign in Join

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

Mailing lists / lazarus / 2000-01

TNotebook

9 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

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

Shane Miller

Has anyone noticed this problem.
Write code to create a new page on a notebook and set the pageindex to the new page. I get a "Contrl has no parent" error and it freezes on me.

Anyone else get this?
Shane

Reply by email

Kevin Berry

Isn't it so that it is complies with Delphi's way of doing things?? I know that with the VCL under Delphi you have to do the same thing. I'm sure there's a good reason for it...

--- Stefan Hille wrote:
[...snip...]

Show quoted text 14 lines
myObject := TSomeObject.Create (self); myObject.Parent := self; I always wanted to ask why this new behaviour has been introduced but just forgot about that. bye, Stefan --

---------------------------------------------------------

Show quoted text 5 lines
Stefan Hille email: 48155 Muenster voice: 0251/664695

_________________________________________________________________

Show quoted text 6 lines
To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

__________________________________________________ Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com

Reply by email

Stefan Hille
to Kevin Berry: Isn't it so that it is complies with Delphi's way of doing things?? I know that with the…
Kevin Berry wrote 5 lines
Isn't it so that it is complies with Delphi's way of doing things?? I know that with the VCL under Delphi you have to do the same thing. I'm sure there's a good reason for it...

You're right, just looked at the delphi-docs. But in fact I've already created components in Delphi without setting the parent property. Strange...

bye,

Stefan

--------------------------------------------------------- Stefan Hille email: 48155 Muenster voice: 0251/664695

Reply by email

Marc Weustink
to Stefan Hille

+ -----Original Message-----
+ From: Stefan Hille
+
+ On Wed, Jan 05, 2000 at 01:50:58PM -0800, Kevin Berry wrote:
+ > Isn't it so that it is complies with Delphi's way of
+ > doing things?? I know that with the VCL under Delphi
+ > you have to do the same thing. I'm sure there's a
+ > good reason for it...
+ >
+ You're right, just looked at the delphi-docs. But in fact I've already
+ created components in Delphi without setting the parent property.
+ Strange...

Some components don't require a parent, lately I ran into one and fixed this in Lazarus, however I can't remember which one. As a general rule you can say that every GUI component has to have a parent (except forms). Most of the time if you are creating components in Delphi you use the IDE to place them on a form. The parent is then set by the IDE (so you dont have to set it yourself).

Marc

Reply by email

Stefan Hille
to Shane Miller: Has anyone noticed this problem. Write code to create a new page on a notebook and set…
Shane Miller wrote 7 lines
Has anyone noticed this problem. Write code to create a new page on a notebook and set the pageindex to the new page. I get a "Contrl has no parent" error and it freezes on me. Anyone else get this? Shane

Not directly, but when I updated some examples during the last week I noticed that parent is no longer set automatically to AOwner during Create. So for every object you have to call

  myObject := TSomeObject.Create (self);
  myObject.Parent := self;

I always wanted to ask why this new behaviour has been introduced but just forgot about that.

bye,

Stefan

--------------------------------------------------------- Stefan Hille email: 48155 Muenster voice: 0251/664695

Reply by email

Samuel Liddicott
to Marc Weustink: Look in the archives for a discussion about owners and parents. Most of the time they are…
Show quoted text 16 lines
-----Original Message----- From: Marc Weustink Sent: Wednesday, January 05, 2000 10:15 PM To: Subject: Re: [lazarus] TNotebook At 13:50 05-01-2000 -0800, you wrote: >Isn't it so that it is complies with Delphi's way of >doing things?? I know that with the VCL under Delphi >you have to do the same thing. I'm sure there's a >good reason for it... Look in the archives for a discussion about owners and parents. Most of the time they are the same,

er..... for most graphical controls the owner is always the form, but the parent is the control they were placed on (the panel, the notebook page, the toolbar etc etc)

Sam

Reply by email

Kevin Berry

That makes sense.

--- Samuel Liddicott wrote:
[...snip...]

Show quoted text 10 lines
er..... for most graphical controls the owner is always the form, but the parent is the control they were placed on (the panel, the notebook page, the toolbar etc etc) Sam

__________________________________________________ Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com

Reply by email