为什么 Tk GUI 被认为是丑陋的? [英] Why are Tk GUI's considered ugly?

查看:89
本文介绍了为什么 Tk GUI 被认为是丑陋的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Tk GUI 似乎被普遍认为是丑陋的,但我想知道具体的原因.Tcl/Tk 世界中的一些人会争辩说这是一个有争议的问题,因为现在对原生外观和感觉有更好的支持,这是我决定使用 Tcl/Tk 的一个重要原因.然而,现在问题是,因为我正在利用 Tcl/Starkit vfs(虚拟文件系统),本地文件对话框不起作用,我将不得不恢复到纯 Tk 文件对话框.

请我寻找具体的技术原因,例如关于字体别名(或缺少)或字体样式,或颜色等.因为我个人不买这对我来说很丑".对我来说,它只是不同,我经常在 Mac、Windows 和 Linux 之间切换,所以我习惯了不同的外观/感觉.

具体来说,传统 Tk GUI 的主题式外观被认为是丑陋的:

解决方案

我认为部分原因是 Tk 非常强大且易于使用,但它并没有做太多的手动操作.由于它非常简单,UI 设计经验很少的人可以在很短的时间内完成一些工作.但是,在没有很多经验的情况下,他们依赖于默认值和解决方案的最短路径(阅读:在不需要滚动条时不要花时间隐藏滚动条,不要对工具栏使用常见的习惯用法,不要t 正确对齐小部件等).

不幸的是,Tk 的默认设置并不总是最漂亮的.正如问题中的屏幕截图所示,默认使用相对较粗的边框宽度和次优字体,复选框确实是 80 年代的.然而,在专家的手中,所有这些问题都是可以在闲暇时解决的小问题.

例如,经过五分钟的调整,原始屏幕截图可能如下所示:

当然,这看起来仍然有点笨拙,但可以说它比原版好很多.用一个小时来完成这项任务,还可以做出更多改进.

使用 tk 8.5(实际上是几年前)支持主题和本机小部件,甚至 X11 版本也进行了小改款.尽管如此,Tk 仍然落后于吸引眼球的曲线,如果设计需要渐变、动画等,则迫使人们自己动手".

然而,Tcl 和 Tk 对于大多数类型的应用程序来说仍然是一个很好的实用解决方案.如果您试图与 Flash 应用程序竞争,您将失败.但是,如果您的工业应用程序只需要工作和可用,并且可能是多平台的,那么 Tk 仍然是最好的选择之一.

<小时>

截至 2015 年,有一篇关于对 Tkinter 的 IDLE IDE 进行现代化改造的文章.文章描述了使 IDLE 看起来更现代的一些步骤:

Tk GUI's seem to be universally considered ugly, but I'd like to know why specifically. Some in the Tcl/Tk world would argue that this is a moot point as there is much better support now for native look and feel, which is a big reason I decided on Tcl/Tk. Now, however, the problem is, because I'm leveraging a Tcl/Starkit vfs (virtual file system), the native file dialogs don't work, and I'm going to have to revert to pure Tk file dialogs.

Please I'm looking for specific, technical reasons, e.g. regarding font aliasing (or lack thereof) or font style, or color, etcetera. Because I personally don't buy the "it's just ugly to me". To me, its just different, and I switch between Mac and Windows and Linux with regularity, so I'm used to different looks/feels.

Specifically, motif-ish look of a traditional Tk GUI is regarded as ugly:

解决方案

I think part of the reason is that Tk is surprisingly powerful and easy to use but it doesn't do much hand-holding. Since it is so easy, people with little experience in UI design can get something to work in very short order. But, without a lot of experience they rely on defaults and shortest-path-to-a-solution (read: don't take time to hide scrollbars when they aren't needed, don't use common idioms for toolbars, don't properly align widgets, etc).

Unfortunately, Tk's defaults aren't always the prettiest. As the screenshot in the question shows, the default uses relatively thick border widths and suboptimal fonts, and the checkboxes are indeed straight out of the 80's. In the hands of an expert, though, all these problems are minor issues that can be take care of in idle moments.

For example, with five minutes of tweaking, the original screenshot can look like this:

Certainly that's still a bit clunky looking, but arguably it's better than the original by a considerable bit. With an hour dedicated to the task, several more improvements could be made.

With tk 8.5 (and actually for a couple years prior) there is support for themes and for native widgets, and even the X11 version gets a minor facelift. Tk is still behind the curve in eye candy though, forcing one to "roll their own" if the design calls for gradients, animations and so forth.

Tcl and Tk, however, remain a good pragmatic solution for most types of applications. If you're trying to compete with a flash application you'll lose. But if you have an industrial application that just needs to work and be usable and perhaps multi-platform, Tk is still one of the best choices out there.


As of 2015, there's a nice write-up about modernizing Tkinter's IDLE IDE. The article describes some of the steps taken to make IDLE more modern looking:

这篇关于为什么 Tk GUI 被认为是丑陋的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆