Graeme Geldenhuys wrote:
> Hi,
> 
> This is not directly related to Lazarus, but thought the developers
> here know widget sets, so might be able to answer this.
> 
> In fpGUI, I create one window handle per form (window) and is shared
> by all widgets on that form. LPTK (another widget set written in
> Object Pascal) allocates a window handle for every widget. The LPTK
> author says this is much easier to handle, causes simpler and shorter
> code, and you don't have to take care of the clipping so much.
> 
> I was always in the impression that more window handles = more
> resources = more memory.
> 
> What is the preferred way of doing this?  What would be the benefit or
> drawback of each? Do some platforms suffer when using more window
> handles?

Personally I would go for a handle per widget (but I like native controls).
 painting is clipped for childs..
 messages are passed the handle..
 enable/disable are handled (disabled wil receive no messages)

But one handle for all is imo also an option if you want to paint and do
everything yourself (no native controls)

The way to go is up to you, there are only some numbers to keep in mind.

DOS-based windows have 3 global pools of 32/64k each for allocation info
for window handles, GDI objects and I forgot the 3rd. Sehared over all apps.
NT-based windows have the same pools, but then for each process. The max
number of handles on NT (ran into it on XP) for graphics, windows, etc
is about 16k in total, with a limit of 10k for a process.



Marc

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to