8.4中的tcl 8.6包 [英] tcl 8.6 package in 8.4

查看:159
本文介绍了8.4中的tcl 8.6包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Tcl/Tk 8.6中,有一个称为笔记本的Ttk功能,我想在程序中实现.但是,我需要该软件包才能使用此功能.我必须使用8.4,因为我们使用的dll之一仅与8.4版本兼容(我的沮丧之源).

In Tcl/Tk 8.6 has a Ttk feature known as notebook which I would like to implement into my program. However, I need the package to be able to utilize this feature. I have to use 8.4 since one of the dlls that we are using is ONLY compatible with version 8.4 (source of my frustration).

我已经下载了Tcl 8.6的源代码,并找到了Notebook.tcl.我模仿了BWidgets文件夹中的文件夹结构,希望可以将其导入到程序中而无济于事.关于如何从Tcl 8.6获取软件包以使其在8.4上正常工作的任何想法?

I have downloaded the source for Tcl 8.6 and found the Notebook.tcl. I have mimiced the folder structure from BWidgets folder hoping that I could get it to import into the program with no avail. Any thoughts on how I can get a package from Tcl 8.6 to work properly with 8.4?

推荐答案

Ttk小部件集最早出现在Tk 8.5中;此后便可以使用笔记本小部件.但是,Ttk窗口小部件(非常紧密地基于 !)基于名为作者具有

The Ttk widget set first appeared in Tk 8.5; the notebook widget was available from then onwards. However, the Ttk widgets were based (very closely based!) on a widget extension package called Tile about which the author has said:

只要Tcl/Tk 8.4仍然是可行的平台,

Tile将一直作为8.4兼容扩展进行维护.每个人都需要一段时间才能升级到8.5.

Tile will be maintained as an 8.4-compatible extension for as long as Tcl/Tk 8.4 remains a viable platform. It will take a while before everyone can upgrade to 8.5.

我不确定100%是否可以将Tile用于您正在做的事情,但是它有 got 值得一试!

I'm not 100% sure if you can use Tile for what you're doing, but it has got to be worth a try!

如果这不起作用,您可能会考虑将程序拆分为两个通过管道进行通信的进程.效果很好; Tcl对管道的处理非常好.这样一来,您就可以将8.5或8.6用于GUI,将8.4用于旧扩展.

If that doesn't work, you might think about splitting you program into two processes that communicate via a pipe. That works pretty well; Tcl's handling of pipes is pretty good. That would let you use 8.5 or 8.6 for the GUI and 8.4 for the old extension.

如果正在使用8.4代码创建窗口小部件,而您在Unix/X11上,则您甚至可以嵌入包装的8.5/8.6 GUI框架中的8.4小部件.关键在于,将-container true设置为打开的帧和将-use $id设置为打开的顶层可以处于不同的进程中.只需制作容器框架,并使用winfo id获取其ID,然后在创建它时将其发送给其他进程,这样它就可以创建使用该框架作为其容器的顶层. (使用命令行参数效果特别好,因为它使您可以控制.顶层的选项.)

If that 8.4 code is being used for creating a widget and you are on Unix/X11, you could even embed the 8.4 widget in a frame of the wrapping 8.5/8.6 GUI. The key is that the frame that you set -container true on and the toplevel that you set -use $id on can be in different processes; just make the container frame, get its ID with winfo id, and send that to the other process when you create it so it can create a toplevel that uses that frame as its container. (Using a command line parameter works especially well as that lets you control the options to the . toplevel.)

set f [frame .foo -container true]
set id [winfo id $f]
set pipeline [open |[list wish8.4 your84script.tcl -use $id] "r+"]

(这是Tcl/Tk浏览器插件的工作方式.)

这篇关于8.4中的tcl 8.6包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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