[lazarus] More Native Win32 stuff(Pascal,canyouhelphere?)

Jeff Wormsley daworm at cdc.net
Tue Aug 10 17:28:42 EDT 1999


On 8/10/99, at 3:38 PM, Shane Miller wrote: 

>Here is a basic map of how it's done:
>
>We call gtkint.pp and send it a "message" or "command" LM_CREATE.
>gtkint.pp says 'Hey, I received a LM_CREATE so they want me to create something!" (That's the English version of gtkint.pp talking of course)
>
>gtkint then checks the SELF parameter (as a tcontrol) and check's it's compstyle and says "Hey, it's a compstyle is csFORM so I'll create a FORM!'.  (gtkint.pp is very excitable, that's why it talks that way.)

Aaarrrgghhhh.  This is exactly where I am having the problem!!!  "Hey, it's a compstyle is csFORM so I'll create a FORM!' HOW!!! Presumably the TForm is in the process of being created (which is why I got the LM_CREATE in the first place).  What this LCL TForm is missing is a Window, a window handler, and events.  Below, you cover the events.  I know how to create a window.  Where do I create, or is already created, the window handler???  I have read it is already in TObject in one place, and that I have to create it in another, and I am lost as to what I am supposed to do.

>So, now in order to detect when someone clicks on the form, TControl (for TForm) calls SetCAllBack(LM_CLICKED) and that's passed onto gtkint.pp.
>
>GtKINT.PP get's it's SetCallBack called with a SELF and a LM_CLICKED so it sets a callback procedure up to be called when a clicked event occurs.  In that callback, it uses the SELF to call DISPATCH(LM_CLICKED). 

Again, where is this callback procedure declared?  In gtkint.pp?  How do you get a unique one for each control if the code is in gtkint.pp?  

>The LM_CLICKED is dispatch to TOBJECT, and it climbs UP the object tree looking for a procedure defined as
>
>Procedure Something(var Message) message LM_CLICKED;
>
>and when it sees that, it calls that procedure....
>
>Basically that's how the messaging works.  You should be able to do the exact same thing with WIN32.

With the two exceptions above, I follow you.  But gtk hides so much of what is going on in the DLL's it is impossible for me to know what is going on.  Just seeing a call to gtk_main tells me nothing.  It is beginning to look like I am going to have to create a completely independent TForm which is equivalent to a gtk widget (I forget the name, the one called by the create for MainForm).  This can't be right.

>I hope this helps.

I wish it did.  Thanks for trying.  It must be getting on everyones nerves by now.  I feel as thick as the base of the great pyramid right now.

Jeff.







More information about the Lazarus mailing list