ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
## Visual Tcl PAGE is based on Stewart Allen’s Visual Tcl program. In fact, it is vTcl, with modifications and several additional modules that generates Python code. And yes, it is written in Tcl! Why not? Tcl is a great language to have available on your machine. It has features which I would like to see in Python. There are many great programs written in that language. Further, it leaves the door open to use the same techniques for GUI builders in other languages which support Tk. The disadvantage of using a Tcl implementation is that one is restricted to widget sets which are available to both Tcl and Python. Ann additional disadvantage is that Windows users probably need to install Tcl/Tk. In previous versions of PAGE, I supported Tix widgets to provide a comprehensive widget set. With the arrival of ttk widgets in Tcl/Tk 8.5, I felt that the ttk widget set was sufficient and dropped Tix. PAGE基于Stewart Allen的Visual Tcl程序。 实际上,它是vTcl,经过修改和生成Python代码的其他几个模块。 是的,它是用Tcl编写的! 为什么不? Tcl是一种很棒的语言,可在您的计算机上使用。 它具有我想在Python中看到的功能。 有很多用这种语言编写的程序。 此外,它为其他支持Tk的语言的GUI构建器使用相同的技术提供了方便。 使用Tcl实现的缺点是只能使用Tcl和Python都可以使用的小部件集。 另一个缺点是Windows用户可能需要安装Tcl / Tk。 在PAGE的早期版本中,我支持Tix小部件以提供全面的小部件集。 随着ttk小部件在Tcl / Tk 8.5中的出现,我觉得ttk小部件集已足够并删除了Tix。 PAGE is a modified version of Visual Tcl. Visual Tcl is a interactive Tcl/Tk program for generating whole projects in Tcl/Tk. Building PAGE, I added the feature of also generating a Python program which realizes the same GUI. My changes were primarily to: PAGE是Visual Tcl的修改版本。 Visual Tcl是一个交互式Tcl / Tk程序,用于在Tcl / Tk中生成整个项目。 构建PAGE时,我添加了还生成可实现相同GUI的Python程序的功能。 我的更改主要是: * Add the modules which generate Python code. * 添加生成Python代码的模块。 * 为ttk小部件集以及一些小部件(如列表框,文本框和树视图)的滚动版本的Visual Tcl添加支持。 * Aim the program to handle only one top level window. I ditched the whole window project orientation. Facilities for testing Tcl programs, for defining functions, support for multiple toplevel windows, and support for geometry managers other than the placer geometry manager were among those deleted. * 旨在使该程序仅处理一个顶级窗口。 我放弃了整个窗口项目的方向。 其中删除了用于测试Tcl程序,定义功能,支持多个顶层窗口以及支持几何图形管理器(而不是放置几何图形管理器)的功能。 * Simplify the interface to only support the needs of one building Python interfaces. * 简化接口,使其仅支持一个构建Python接口的需求。 * Write some documentation and comments for the program. Documentation of Virtual Tcl is virtually nonexistent and that is truly sad but all too common with open source programming. * 为该程序编写一些文档和注释。 Virtual Tcl的文档实际上是不存在的,这确实让人很难过,但在开源编程中太普遍了。 * Fix bugs. My changes have become so numerous that it is perhaps wrong to call it merely a modification of Virtual Tcl. I now think of PAGE as a fork which will probably be of little interest to the maintainers of Vtcl nor should they be saddled with any responsibility for the state of my version. Since I have diverged so much from Visual Tcl, I decided to replace the Visual Tcl splash screen. 我的更改变得如此之多,以至于仅将其称为Virtual Tcl的修改就是错误的。 我现在把PAGE看作是一个分支,这可能对Vtcl的维护者们没什么兴趣,也不应该为我的版本状态承担任何责任。 由于我与Visual Tcl的差异很大,因此我决定更换Visual Tcl初始屏幕。 I was looking at different GUI generators for Tcl/Tk with a view of converting the output of one to Python when I came across Visual Tcl and the work of Constantin Teodorescu in generating Java from Visual Tcl. I thought if one could automatically generate Java, it should be even easier and much better to generate Python. 当我遇到Visual Tcl和Constantin Teodorescu从Visual Tcl生成Java的工作时,我正在研究Tcl / Tk的不同GUI生成器,以将其输出转换为Python。 我以为如果可以自动生成Java,则生成Python应该更容易,更好。 I believe that Stewart Allen wrote Visual Tcl in the 1996-1998 time period to aid in the development of Tcl/Tk applications. Constantin Teodorescu modified vTcl to generate Java code using SWING as the widget set. Looking at the Java generator convinced me to try doing PAGE. I was able to discern its behavior in spite of the nearly total lack of documentation, usually finding an existing procedure when needed. 我相信Stewart Allen在1996-1998年期间撰写了Visual Tcl,以帮助开发Tcl / Tk应用程序。 Constantin Teodorescu修改了vTcl以使用SWING作为窗口小部件集来生成Java代码。 看着Java生成器说服了我尝试进行PAGE。 尽管几乎完全没有文档,但是我仍然能够辨别它的行为,通常在需要时找到一个现有的过程。 PAGE supports only the placer geometry manager. In the past, I worked with Visual Basic and the placer geometry manager seemed comfortable and got me useful results. Similarly, Constantin Teodorescu also limited the Java generation to the placer geometry manager. It seems really natural with the drag and drop paradigm. One disadvantage is that some of the sizes could be wrong if fonts change. This is because several Tk widgets have sizing based on font parameters. This has implications if the GUI is generated with different fonts or resolution than are active during execution. There may also be similar problems if the generated GUI is moved to other platforms or environments. It is interesting that many people writing about Tk and Tkinter dismiss the placer geometry manager. PAGE仅支持布局几何管理器。 过去,我曾与Visual Basic一起工作过,而砂轮几何管理器似乎很舒适,并为我提供了有用的结果。 同样,康斯坦丁·特奥多雷斯库(Constantin Teodorescu)也将Java代仅限于布局几何管理器。 拖放范例似乎很自然。 一个缺点是,如果更改字体,某些大小可能会出错。 这是因为几个Tk小部件具有基于字体参数的大小。 如果生成的GUI具有与执行期间不同的字体或分辨率,则可能会产生影响。 如果将生成的GUI移至其他平台或环境,也可能会出现类似的问题。 有趣的是,许多关于Tk和Tkinter的文章都忽略了布局几何管理器。