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).
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?
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:
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.
I'm not 100% sure if you can use Tile for what you're doing, but it has got to be worth a try!
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.
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+"]
(This was how the Tcl/Tk browser plugin worked.)