Really, really, really, nit-picky....
- Posted by Jonas Temple <jktemple at yhti.net> Aug 22, 2001
- 391 views
Okay, no cause for alarm here...just found something in Win32lib that I would wager most of us have never tried (at least I never did). Has anyone ever tried to change the appearance of Windows desktop and use a Win32lib program? What I mean is right-clicking in the desktop, selecting the "Properties" item from the pop-up, selecting the "Appearance" tab and changing the "Desktop" item scheme to something other than Windows Standard and then running a program that uses Win32lib? Go ahead...try it...I'll wait...did you notice that your Win32lib program did not change the background color of labels, windows, checkboxes, etc.? Not really a big thing but it would be noticed by users wanting to change their desktop colors. To that end I humbly submit the following code: -- On a paint call check if the current button face color has changed -- and if so set all label controls and windows to the correct background color -- as well as the main window background color. atom cur_color cur_color = 0 procedure MainWin_onPaint(atom x1, atom y1, atom x2, atom y2) object color color = getSysColor(COLOR_BTNFACE) if color != cur_color then cur_color = color -- Set all window controls background setWindowBackColor( MainWin, color ) -- Set label background setWindowBackColor( CurProjLT, color ) -- Set group control backgrounds setWindowBackColor( PrintTypeGroupGC, color ) -- Set radio button backgrounds setWindowBackColor( PrintDetailRB, color ) end if end procedure onPaint[MainWin] = routine_id("MainWin_onPaint")