Dnia piątek, 25 marca 2011 o 12:43:14 Aldo Calpini napisał(a): > 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.
Of course you are right. It is not a problem with using font in general but with my using them. > > 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 :-) You right again; this syntax is really friendly but the real problem with the error was that it feeds the GDI quota limit vary fast (in my application) - not just the memory. Adding bad desing with fonts and error in Perl 5.10 you can see my problems... :( But thankfull Jeremy code I fixed the error and using Perl 5.8 version with changes in my application give the result that I have quite stable application now. I tried to do it in 5.12 but I didn't manage. At first ExtUtils::FakeConfig from cpan had no 5.12 version. I thank I corrected it but compilation Win32::GUI with gcc failed (tests showed it). Because I can't find ppm for 5.12 so I think I have made a mistake writing the information about Win32::GUI in Perl 5.12. Sorry for that. > 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. This would be fine for I use them (backgrounds) synchronized in my windows so I can get the same colour to the quite big group of widgets. cheers Waldemar. ------------------------------------------------------------------------------ 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/