Sign in Join

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

Mailing lists / lazarus / 2000-04

QT Loop Problem

6 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Marc Weustink
to codepunk: If I comment out the style line the program exits as it should.. Cliff

+ From: codepunk
+
+ If I comment out the style line the program exits as it should..

+ On Thu, 13 Apr 2000, Shane Miller wrote:
+ > in CreateParams you are setting
+ > STYLE := ...
+ >
+ > Does that do a handleneeded which tries to create the
+ > handle by calling CreateParams and so forth? Then it loops?

??? Can't see why.

Style is a member of the Params structure, So you are doing a WORD := WORD +
SOME_CONSTANTS

That doesn't call handleneeded.
But, Clif while creating the widget do you set the handle of the LCLcomponent (before refering to LCL component istelf) ?

If not, the Handle stays 0 and HandleNeeded tries to create the widget and so on.

Marc

Reply by email

codepunk
to Marc Weustink

No I did not set the widget handle but we should place a check somewhere that eliminates the cycling. Right now all I did was created a interface unit and compiled hello world. In theory I should just be able to run this and have the code just fall thru and exit due to not getting caught by the main event loop of the called library be it gtk or qt. Once I can get that to occur it should take me less than 15 min to get forms and buttons working enough for a successful compile of hello world. Last night I fought it long enough to screw up my copy of the LCL so I will have to start new again tomorrow. Can't work on it tonight I have a Matrix party to attend this evening with all of the local geeks.

Cliff

Marc Weustink wrote 29 lines
+ From: codepunk + + If I comment out the style line the program exits as it should.. + On Thu, 13 Apr 2000, Shane Miller wrote: + > in CreateParams you are setting + > STYLE := ... + > + > Does that do a handleneeded which tries to create the + > handle by calling CreateParams and so forth? Then it loops? ??? Can't see why. Style is a member of the Params structure, So you are doing a WORD := WORD + SOME_CONSTANTS That doesn't call handleneeded. But, Clif while creating the widget do you set the handle of the LCLcomponent (before refering to LCL component istelf) ? If not, the Handle stays 0 and HandleNeeded tries to create the widget and so on. Marc _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Marc Weustink
to codepunk

+ From: codepunk

+ No I did not set the widget handle but we should place a
+ check somewhere that eliminates the cycling.

Nope, you can't. CreateWindow is supposed to create a window. If it cant create one we can raise an exeption but thats it. (If it can't create a window then it makes no sense to continue).

+ Right now all I did was created a interface unit and
+ compiled hello world. In theory I should just be able to run
+ this and have the code just fall thru and exit due to not
+ getting caught by the main event loop of the called library
+ be it gtk or qt.
+ Once I can get that to occur it should take me less than 15 min
+ to get forms and buttons working enough for a successful
+ compile of hello world.

Hmm..... As long as you don't refer to the Handle before you've created the widget (and in your case don't refer to the handle in QTobject at all, since you dont create anything) Everything should continue. Now I think of it I guess that I assumed sometimes that a handle is created after a createwindow. Maybe if I can find some time this weekend I'll look at it.

Marc

Reply by email

codepunk
to codepunk: The loop is in this procedure what is the best way to fix it? What type of base object is…

If I comment out the style line the program exits as it should..

Cliff

Shane Miller wrote 60 lines
in CreateParams you are setting STYLE := ... Does that do a handleneeded which tries to create the handle by calling CreateParams and so forth? Then it loops? --------------------------------------- Shane Miller Take a look at other product/projects of mine below! Get paid to surf the net! http://alladvantage.com/go.asp?refid=DEX-870 Get paid to surf the net by clicking here too!!! http://epipo.com/sine.asp?dex870 Home page : http://www.lakefield.net/~smiller Auto-IP Publisher : http://www.lakefield.net/~smiller/autoip Advanced Clipboard : http://www.lakefield.net/~smiller/advclipboard Lazarus : http://www.lazarus.freepascal.org ----- Original Message ----- From: "codepunk" To: Sent: Friday, April 14, 2000 1:34 AM Subject: [lazarus] QT Loop Problem > The loop is in this procedure what is the best way to fix it? > > What type of base object is params can I place a exit check in it.? > > Cliff > > procedure TCustomForm.CreateParams(var Params : TCreateParams); > begin > inherited CreateParams(Params); > with Params do > begin > if (Parent = nil) {and (ParentWindow = 0)} then > begin > // WndParent := Application.Handle; > { TODO : No application handle } > Style := Style and not (WS_CHILD or WS_GROUP or WS_TABSTOP); > end; > end; > end; > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus > _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Shane Miller
to codepunk: The loop is in this procedure what is the best way to fix it? What type of base object is…
in CreateParams you are setting
STYLE := ...

Does that do a handleneeded which tries to create the handle by calling CreateParams and so forth? Then it loops?
---------------------------------------
Shane Miller
Take a look at other product/projects of mine below!

Get paid to surf the net!
http://alladvantage.com/go.asp?refid=DEX-870

Get paid to surf the net by clicking here too!!!
http://epipo.com/sine.asp?dex870

Home page : http://www.lakefield.net/~smiller

Auto-IP Publisher : http://www.lakefield.net/~smiller/autoip

Advanced Clipboard : http://www.lakefield.net/~smiller/advclipboard

Lazarus : http://www.lazarus.freepascal.org

Earlier message 32 lines
----- Original Message ----- From: "codepunk" To: Sent: Friday, April 14, 2000 1:34 AM Subject: [lazarus] QT Loop Problem > The loop is in this procedure what is the best way to fix it? > > What type of base object is params can I place a exit check in it.? > > Cliff > > procedure TCustomForm.CreateParams(var Params : TCreateParams); > begin > inherited CreateParams(Params); > with Params do > begin > if (Parent = nil) {and (ParentWindow = 0)} then > begin > // WndParent := Application.Handle; > { TODO : No application handle } > Style := Style and not (WS_CHILD or WS_GROUP or WS_TABSTOP); > end; > end; > end; > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus >

Reply by email

codepunk

The loop is in this procedure what is the best way to fix it?

What type of base object is params can I place a exit check in it.?

Cliff

procedure TCustomForm.CreateParams(var Params : TCreateParams);
begin
  inherited CreateParams(Params);
  with Params do
  begin
    if (Parent = nil) {and (ParentWindow = 0)} then
    begin
     //    WndParent := Application.Handle;
      { TODO : No application handle }
      Style := Style and not (WS_CHILD or WS_GROUP or WS_TABSTOP);
    end;
  end;
end;

Reply by email