**How To Upgrade Tkinter On Mac OS 10.4** ***Overview:*** Tkinter is the interface between Python and the Tk framework. Just because you may have upgraded your Tcl Tk frameworks doesn't mean you will be able to use your new version of Tk in Python immediately. In this tutorial we are going to upgrade Tcl and Tk from 8.4.7 to 8.5.12. The benefits are more widgets available to your applications. Version 8.5.12 is the latest version that will build on Mac OS 10.4 easily. It will probably build on older and newer versions of Mac OS X as well. ***Directions:*** Download both the tcl and tk version 8.5.12 from these download links: * ftp://ftp.tcl.tk/pub/tcl/tcl8_5/tcl8.5.12-src.tar.gz * ftp://ftp.tcl.tk/pub/tcl/tcl8_5/tk8.5.12-src.tar.gz Open the terminal application. Enter this command to make a new folder in your home folder: mkdir tcltk Move the downloaded files into this folder. The home folder can be found on the sidebar. It is the home icon. Click it to display your home folder. The tcltk folder should be here. Expand both files by simply double-clicking on them. Execute this command in terminal: cd tcltk (your terminal should be in the tcltk folder now) In the terminal, enter these commands one at a time and push enter to execute each one: (these commands build tcl and tk) * make -C tcl8.5.12/macosx * make -C tk8.5.12/macosx (these commands install tcl and tk in the /Library/Frameworks/ folder. They will be called Tk.framework and Tcl.framework). * sudo make -C tcl8.5.12/macosx install * sudo make -C tk8.5.12/macosx install If everything went to plan, you now have an upgraded tcl and tk frameworks. To check, open a new terminal window, then enter 'tclsh'. This will open the tclsh program. You will see a %. Now enter 'puts $tcl_version'. If you see 8.5, you are using the newly installed tcl software. Good job. To quit tclsh, type 'exit'. If you didn't open a new terminal window, the old session might not see all the changes the installation have made. This could lead to problems. Now we need to see if Tk 8.5 is working. To do this, simply type 'wish' into the terminal. The wish application will open up. Click on its Application menu and select "About Tcl & Tk...". You will hopefully see something that says "Tcl 8.5.12 & Tk 8.5.12". If you did, it means you are doing great. The File menu has the "Run Widget Demo" menu item. I suggest you try it out. You will see a demonstration of all the widgets you have available to you. At this point you may be tempted to run Python and see if Tkinter is using your new software. If you do, you will be disappointed at this point. Your Python was made to use the older version of Tk that came with Mac OS X. Now it is time to upgrade Python so it knows to use the new Tk framework. I found the easiest way to install Python is to use TigerBrew. It is a package manager made for older Macs using Mac OS 10.4 and 10.5. To install it, start by downloading it from here https://github.com/mistydemeo/tigerbrew. You will see a page with files listed. Simply scroll down the page until you see "Installation". From there you will learn how to install and use TigerBrew. But for now, these commands will do: * export PATH=/usr/local/sbin:/usr/local/bin:$PATH * ruby -e "$(curl -fsSkL raw.github.com/mistydemeo/tigerbrew/go/install)" Question: why not just make it so that TigerBrew can install Python and Tk for me? Answer: It can currently install Python, but there is a problem with the Tcl-Tk package that prevents it from installing on Mac OS 10.4 (it tries to install version 8.6.6, which is not very compatible with Mac OS 10.4). The maintainer for the project has been notified of this issue. Hopefully a fix will be developed soon. If you are using Mac OS 10.5 or later, installing everything you need might be as simple as: brew install python --with-tcl-tk Question: can I install Tk 8.6 on Mac OS 10.4? Answer: Yes, but you would probably not like the result. That version would need X11 in order to work. It would be very unmac-like. The widgets wouldn't have the aqua look and feel that we all know. They would look pretty flat and uninteresting. Please see this page if you are still interested: https://github.com/mistydemeo/tigerbrew/issues/430. In order to build Python so that it uses our new version of Tk, we have to make a few changes to the formula TigerBrew uses. Question: Couldn't I just build Python from source? Answer: Possibly, but I haven't succeeded that way. All my attempts have failed. Steps to install Python (execute these in the terminal): * export EDITOR=/Applications/TextEdit.app/Contents/MacOS/TextEdit * brew edit python * Clear all the text in this file by simply selecting all the text and deleting it. * Download this file: http://www.mediafire.com/file/saprdo7d9f5jupn/replacement_python.rb * Copy and paste the text in the new formula into the TextEdit window. * Save the file. * Quit TextEdit. * Enter this command in the terminal and execute it: 'brew install python'. After Python is done installing, you will want to test it out. Open a new terminal window and type 'Python'. The Python command should be running. You should see text like this: "Python 2.7.12 (default, ...". The date you built Python should be displayed after "default". Enter this code and try executing it: ====== from Tkinter import * print TkVersion ====== You should see 8.5 printed on the screen. This means you have done it. You have successfully updated Tkinter! Try this program out to see Tkinter in action: ====== from Tkinter import * from ttk import * root = Tk() combobox = Combobox(root) combobox['values'] = ("You did it!", "You are wonderful!", "Everyone loves you!") combobox.set("You did it!") combobox.pack() mainloop() ====== ***Conclusion:*** You now have a better version of Tkinter to enjoy. If you want to contact me I can be reached here: programmingkidx@gmail.com ***Troubleshooting:*** I suggest creating a new folder somewhere that will hold all the files. It is probably best to give this folder a simple name that has no spaces in it. It might also be a good idea to make sure the path to this folder doesn't have any spaces in it. Be sure to have gcc installed. You can install it using Apple's Xcode installation or TigerBrew. There might be software that may require updating or installing before Tcl or Tk can be built on your system. TigerBrew and google might be of use to you.