[lazarus] Lazarus Win32

Jeffrey A. Wormsley daworm at cdc.net
Mon Sep 13 13:20:35 EDT 1999

On 9/13/99, at 5:02 PM, Colin Laplace wrote: 

>Thank you. I know that Lazarus is great for Linux with GTK, but i think
>many Win32 developers won't like to have to distribute huge runtime libs
>(not on Linux, gtk is usually installed there). So i'm just curious to
>a look to it ;-)

Ok.  If you'll look in the LCL subdirectory, you'll find a few units whose
name start with win32.  These are an attempt to map Win32 onto the way GTK
works, so as not to disrupt the GTK development.  The example hello.pp in
the examples directory can be compiled for win32 native, and it displays a
form with a button, but the events do not work.  To make this under win32,
edit the Interfaces.pp file, and change the IFDEF GTK to IFDEF WIN32 (I
usually add a space in front of the one to be removed, you'll see when you
open the file).

You will notice there is a trememndous difference in the GTK implementation
of components than Win32.  The biggest difference to me is the lack of a
WindProc.  My next line of attack was to be the implementation of a
TBaseWin32 component to be able to create a unique WindProc for each
component, and embed the reference to it in the HWnd using SetProp.  Right
now there is only one WindProc for the entire application, which is
entirely too unwieldy.  The TBaseWind32 would have a WinProc method and
some default wm_ messages.  For each component, I was going to subclass the
TBaseWin32 to handle the wm_ messages needed by that component and
translate them to LCL LM_ messages.  Any OS specific state information
needed by the component would be stored there as well.

I am fairly sure this type of implementation would work, I just haven't had
time to implement it.  If you can think of a better way, or would like to
try this, let me know.  I hope to be able to put more into it in a couple
of weeks.


More information about the Lazarus mailing list