[Python编程(第4版)].(Programming.Python.4th.Edition).Mark.Lutz.文字版
developed for scripting languages, tkinter is also a relatively lightweight toolkit, and as such it meshes well with a scripting ...
On the other hand, in exchange for its added complexity, wxPython provides a powerful toolkit. wxPython comes with a richer set ...
installed, Python scripts may also use tkinter to build GUIs under Jython. Jython also has Internet roles we’ll meet briefly in ...
JavaFX A Java platform for building RIAs which can run across a variety of connected devices pyjamas An AJAX-based port of the G ...
tkinter Overview Of all the prior section’s GUI options, though, tkinter is by far the de facto standard way to implement portab ...
Naturally, other factors such as documentation and extensions are important when using a GUI toolkit, too; let’s take a quick lo ...
widgets, paned widgets, scrolled widgets, dialog windows, button boxes, balloon help, and an interface to the Blt graph widget. ...
on ttk widgets, see the entry in the Python library manual or search the Web; this book focuses on tkinter fundamentals, and tix ...
on Unix, or whatever GUI system your Python uses on your Macintosh. The portability of tkinter actually stems from the underling ...
Climbing the GUI Learning Curve On to the code; let’s start out by quickly stepping through a few small examples that illustrate ...
tkinter Coding Basics The gui1 script is a trivial example, but it illustrates steps common to most tkinter programs. This Pytho ...
Making Widgets When widgets are constructed in tkinter, we can specify how they should be configured. The gui1 script passes two ...
Running GUI Programs Like all Python code, the module in Example 7-1 can be started in a number of ways— by running it as a top- ...
You can also avoid the DOS pop up on Windows by running the program with the pythonw.exe executable, not python.exe (in fact, .p ...
enclosing rectangles. As we’ll see later, tkinter arranges widgets in a rectangle according to both their packing order and thei ...
Example 7-6. PP4E\Gui\Intro\gui1e.py—expansion from tkinter import * Label(text='Hello GUI world!').pack(expand=YES, fill=BOTH) ...
expand=YES option Asks the packer to expand the allocated space for the widget in general into any unclaimed space in the widget ...
Example 7-8. PP4E\Gui\Intro\gui1g.py—config and titles from tkinter import * root = Tk() widget = Label(root) widget.config(text ...
This makes the window in just two lines, albeit arguably gruesome ones! This scheme relies on an old coding style that was widel ...
assigned to a name, it would normally be garbage collected (destroyed and reclaimed) by Python immediately after running its pac ...
«
16
17
18
19
20
21
22
23
24
25
»
Free download pdf