On 25.03.2011 11:07, Waldemar Biernacki wrote:
> Until now I rewrote my application to use the fix and first tests are really
> promising. By the way, this tremendous GDI object number was due to the fact
> that each label and textfield had its own font which in turn is just GDI 
> object
> and the same with background.

as I just wrote in another mail, there should be no problem with fonts, 
because you create them explicitly. this means the same GDI object is 
used for all controls. only the brush is created "on-demand" for background.

> Syntax of background color in Win32::GUI is little misleading (-background =>
> 0xffffff) as it suggests that it is simple attribute of a widget. But it is 
> not
> the case: each background is full GDI object too! Maybe - I am just
> speculating - that was the fundamental reason why the background color error
> raised? Who - at first sight - could see that there is a such big difference
> between -background and -foreground?

the difference is in the Win32 API. they allow a plain COLORREF for 
foreground, but only a HBRUSH for background (even if you just want a 
solid color, you have to create a solid brush for this). I thought it 
was "user friendlier" to automatically create a brush of the given 
color. it's just that I forgot to clean it up afterwards :-)

maybe it would be a good idea to add a -backgroundbrush option, so you 
can pass a Win32::GUI::Brush object to it and the same GDI object will 
be used for all controls, as with fonts.

cheers,
Aldo

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
http://perl-win32-gui.sourceforge.net/

Reply via email to