Re: Text Not Showing
- Posted by Lone_EverGreen_Ranger Jan 10, 2012
- 1294 views
Could this be connected with ticket:616 ?
Yes, I suspect that it is.
Yes that ticket and the other thread are the same problem I am having. Has it been fixed?
The problem appears to be in win32lib.ew:fDoCtlColor(). It's there apparently to override the foreground and background color selections for controls. Apparently, the themed settings are slightly different than non-themed settings, at leaast on XP. To turn it off, you can simply modify the function so that it always does:
return {kMainMsg , -1}
If you've been taking advantage of the features of win32lib that use this, of course, they won't work any more (I'm not familiar with the motivation, etc, for this function, so I can't really say more). I found a modification that fixes the issue with the static labels by checking to see if win32lib believes the control should be transparent. Again, in fDoCtlColor, update the if statement that checks for w32WinDefColor to read:
if not equal( classBGColor[ctrl_Type[lControl]], w32BGTransparent ) and not equal(ctrl_Bg_Color[lControl], w32WinDefColor) then
That doesn't fix the combo's issues. I think the problem occurs with the Combo's edit box. Normally, those aren't transparent, so it doesn't get fixed by the transparency check, though the first suggestion, of making this function o NOOP fixes the combo box display.
For completeness, here is the simple example that demonstrates the issue:
include win32lib.ew constant Win1 = create(Window,"Strange",0,Default,Default,400,400,0), TabCtl = create(TabControl,"",Win1,5,5,380,355,0), Tab1 = create(TabItem,"First",TabCtl,0,0,0,0,0), Label1 = create(CText,"Nothing important",Tab1,10,30,360,25,0), Cbox1 = create(Combo,"",Tab1,20,80,250,100,0) WinMain(Win1,Normal)
Matt
Thanks for the tips. I've also noticed changing the color of the text is a workaround, but still not perfect.