On 3 Mar 2008, at 23:41, Christopher Armstrong wrote:
Hi Fred
On 04/03/2008, at 7:06 AM, Fred Kiefer wrote:
Just one comment on this impressive patch. You seem to override some
system colour methods on NSColor to use the Windows colour settings
in
GNUstep. This is the wrong approach to do so. You should be
generating a
new system colour list and send that via the themeDidActivate
notification of your theme. That way even system colours loaded
from a
NIB file would be displayed correctly.
All you have to do is create the list:
list = [[NSColorList alloc] initWithName: @"System"];
and to add your colours to it:
[list setColor: Win32ToGSColor(COLOR_WINDOWTEXT)
forKey: @"controlTextColor"];
Thanks, this looks like just what I was looking for. I know what I
was doing was a hack but I wasn't sure about the way around it.
Also, I'm not sure what patch version you have but I was thinking of
introducing another theme notification called GSThemeDidUpdate or
the like, which is sent the first time a theme is updated, or by a
theme whenever it changes its appearance and requires widgets to be
updated. Another alternative is sending GSThemeDidActivate every
time a theme needs to update its appearance. This is even if the
theme itself does not change but needs to change what it looks like.
It is necessary, because Windows uxtheme (or a similar adapted theme
engine) could undergo a theme change, and we would need to update
our appearance.
I think you should use GSThemeDidActivate when windows changes it's
theme ... because you are activating a new theme (windows has changed
to a new theme).
The notification is meant to mean that a them has become active, not
that a theme engine has changed (for instance, pixmap based themes are
likely to all use the same theme software, just different images).
Essentially this notification tells the gui controls that they should
refresh any cached theme information and redraw themselves ... having
two notifications doing the same thing would seem more trouble than
it's worth.
_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev