[lazarus] Developing win32

Mattias Gaertner nc-gaertnma at netcologne.de
Sat Nov 30 06:18:58 EST 2002


On Sat, 30 Nov 2002 11:42:11 +0100
"Vincent Snijders" <vslist at zonnet.nl> wrote:

> Mattias,
> 
> Thanks for your answers. Still some questions left.
> 
> > -----Oorspronkelijk bericht-----
> > Van: Mattias Gaertner [mailto:nc-gaertnma at netcologne.de]
> >
> > On Fri, 29 Nov 2002 21:44:39 +0100
> > "Vincent Snijders" <vslist at zonnet.nl> wrote:
> >
> 
> <snip>
> 
> > > Firstly it is not clear what messages the LCL is expecting from an
> > > interface object and what messages the an interface object is suposed
> > > to handle. The only way is to look at the gtk interface and put
> > some (a lot)
> > > writelns to see what it does. An example is the the LM_DESTROY message
> > > from the interface to the LCL. When you run lazarus (with gtk
> > on linux) it
> > > only seems to be sent for TPage object and not for TForm.
> >
> > This is because the LCL+gtk does not need any LM_Destroy messages
> > sent back
> > from the interface. But you are right, they should be sent for
> > compatibility.
> If the LCL + gtk doesn't need it, LCL doesn't need it. 

No, it does only mean, that the "base" LCL doesn't need it.
Every interface has some special behaviour and lacks some features. For
example setting the size and position of a form heavily depends on the
window manager. 
Another example are the size messages. Under gtk size messages are sent in a
very different way than under win32. The gtk resizes a widget and its inner
widget independently. The VCL does not distinguish between them, because
win32 does not distinguish. Therefore the LCL must support both. 


> Why should any other
> interface send such a message for compatibility reasons?

I'm not sure if any component will ever need it. The VCL uses it a few
times, so guess we should keep the code. It doesn't hurt.


> > > If you happen to do so on
> > > win32 you get into problems for freeing the form twice (once on the
> > > LM_DESTROY message and once when Application.Free is called).
> >
> > This was a bug in the LCL. Fixed.
> Ok, now the CustomForm doesn't do anything with LM_DESTROY except calling
> inherited. Why not remove the message handler completely?

Right. The VCL uses the message to clean up the menu. This is only needed
under the win32 interface, so it should be done there. I deleted it.


Mattias






More information about the Lazarus mailing list