为什么我在Leopard中创建的对话在Tiger中看起来很糟糕?

时间:2021-12-24 20:47:40

I have created a simple NSWindow with an NSTextField and an NSButton in Interface Builder on Leopard. I set the window background color in my program. Everything looks fine when I run the program in Leopard. But when I run it in Tiger, the background color of the window is not set. It has a default Tiger look with horizontal stripes.

我在Leopard上的Interface Builder中创建了一个带有NSTextField和NSButton的简单NSWindow。我在程序中设置了窗口背景颜色。当我在Leopard中运行程序时,一切看起来都很好。但是当我在Tiger中运行它时,窗口的背景颜色没有设置。它有一个带水平条纹的默认Tiger外观。

Weirdly, the background colors of the NSTextField and NSButton controls are set to the specified window color, so they look really awful.

奇怪的是,NSTextField和NSButton控件的背景颜色设置为指定的窗口颜色,因此它们看起来非常糟糕。

How can I convince Tiger to respect the color I choose in the setBackgroundColor call?

我怎样才能说服Tiger尊重我在setBackgroundColor调用中选择的颜色?

2 个解决方案

#1


If I recall correctly, under Tiger you had to set the background pattern of the window if you wanted to change its color - the 'color' was overridden by the (ugly) default aqua pattern.

如果我没记错的话,在虎下你必须设置窗口的背景图案,如果你想改变它的颜色 - '颜色'被(丑陋的)默认水色图案覆盖。

On the other hand, why the heck are you writing code for Tiger? Something like 0.3% of machines out there run Tiger, and something like 100% of those are run by luddites.

另一方面,为什么你要为Tiger编写代码呢?有0.3%的机器运行Tiger,而100%的机器都是由luddites运行的。

#2


I guess the interface builder is generating some Leopard only styling code somewhere (valid but non functional in api or somesuch), tried creating it on the Tiger machine and see what it looks like in Leopard?

我猜界面构建器在某处生成了一些只有Leopard的样式代码(有效但在api中没有功能或某些功能),尝试在Tiger机器上创建它并看看它在Leopard中的样子?

#1


If I recall correctly, under Tiger you had to set the background pattern of the window if you wanted to change its color - the 'color' was overridden by the (ugly) default aqua pattern.

如果我没记错的话,在虎下你必须设置窗口的背景图案,如果你想改变它的颜色 - '颜色'被(丑陋的)默认水色图案覆盖。

On the other hand, why the heck are you writing code for Tiger? Something like 0.3% of machines out there run Tiger, and something like 100% of those are run by luddites.

另一方面,为什么你要为Tiger编写代码呢?有0.3%的机器运行Tiger,而100%的机器都是由luddites运行的。

#2


I guess the interface builder is generating some Leopard only styling code somewhere (valid but non functional in api or somesuch), tried creating it on the Tiger machine and see what it looks like in Leopard?

我猜界面构建器在某处生成了一些只有Leopard的样式代码(有效但在api中没有功能或某些功能),尝试在Tiger机器上创建它并看看它在Leopard中的样子?