Isosurface Generation Using VTK
|
|||||
Using Python and Tkinter |
|||||
|
|||||
2.2. Tkinter Basics
As stated before, it would probably be better to use wxPython as described in the introduction to this chapter. However, if you have gotten this far, you have probably decided that Tkinter is the GUI that you will use. Before going any farther, the author strongly recommends that you download a PDF file from the web entitled “An Introduction to Tkinter”. This guide will describe many of the functions of different GUI widgets in addition to providing nice composition widgets that try to get around the limitedness of Tkinter. It also provides some key information to why Tkinter sometimes behaves strangely. Another important part of this tutorial is a GUI builder which the author made that can be viewed here. You can modify it for your own purposes. It was created in order to take the tediousness out of writing code to make a GUI work. Additionally, there are some composite widgets such as a listbox with a scrollbar and a slider with a value label not tied to the location of the “moving” part of the slider. In the next subsections, there will be a mini-tutorial for creating a main Tkinter window with a menu bar and a mini-tutorial for making an RGB color changer. In the next chapter, there will also be more mini-tutorials. The idea is that these mini-tutorials will help you understand how to use the objects, understand the basic abilities of an object, and be able to use the object in a bigger project (in this case, the isosurface tutorial in chapter 4). Below are some helpful tips that will assist in the task of programming with Tkinter:
|
|||||
|
|||||
|
|
|
|
||