|
From: Joe E. <jen...@fl...> - 2005-03-06 19:09:07
|
Tile-enabled applications running under GNOME and KDE tend to have mixed-up background colors -- most widgets use the Tile theme background, but others end up with the background color from the GNOME or KDE system settings. Here's what's going on: Neither GTK+ nor Qt use the X resource database themselves, but both GNOME and KDE have an option to apply their system color scheme to "legacy" (i.e., Motif, Xaw, and Tk) applications by munging the X resource database [*]. This doesn't work very well even for standard Tk applications, (see http://bugzilla.gnome.org/show_bug.cgi?id=130299), but it's especially bad for Tile apps since only a few widgets have a -background option. The ones that do end up with one color, and the ones that don't end up with a different one. Possible solutions: (1) Remove the -background option from all widgets. This is undesirable, since for some widgets (entry widgets, labels, possibly frames) it's sensible and useful to control the background on a per-widget basis. (2) Ignore the X resource database. This is actually my preferred solution. Unfortunately Tk doesn't provide a way to do this -- it automagically reloads the RESOURCE_MANAGER property after [option clear], and there's no way to convince it not to. Other possibilities: (2a) Write a TIP to add this feature to Tk. Doable, and probably a good idea in any event, but this won't help Tk 8.4 any. (2b) Rewrite the Tile widgets to ignore the option database. Undesirable; the [option] command is still useful even if the X resource database isn't. (3) Use different database class and database names. That is, instead of using -background/background/Background as the option name/database name/database class, use something like -background/frameColor/FrameColor, so '*background' and *Background settings in the xrdb won't have any effect. #3 looks like the best approach so far. Also: things like labels and frames should have a different default background than things like entry widgets and listboxes; the Tile widgets could/should use different dbnames for these instead of a single "Background" class for everything. [*] More notes: In typical KDE fashion, there is a user preference to disable XRDB munging -- if you can find it. In typical GNOME fashion, there is not. Debian GNOME users won't see this effect, since the Debian package maintainers wisely patch this feature out. CDE and VUE do something similar: <URL: http://tcl.sourceforge.net/faqs/tk/#run/cde > --Joe English jen...@fl... |