rent-now

Rent More, Save More! Use code: ECRENTAL

5% off 1 book, 7% off 2 books, 10% off 3+ books

9781932394627

Wxpython in Action

by
  • ISBN13:

    9781932394627

  • ISBN10:

    1932394621

  • Format: Paperback
  • Copyright: 2006-03-28
  • Publisher: Manning Pubns Co
  • Purchase Benefits
  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $49.95

Summary

Co-authored by the toolkit's developer Robin Dunn, wxPython in Action is the only published source for the wxPython toolkit. This complete resource offers many useful features for learning and using wxPython's objects, including a reference, a tutorial, and many unique examples of working wxPython code. The book is based on real answers to real questions about how each object is used. It shows readers why wxPython is a better interface tool than Tkinter, the tool that is distributed with Python.

Author Biography

Noel Rappin is a senior software engineer at Motorola and a leading Python practitioner

Table of Contents

preface xix
acknowledgments xxii
about this book xxiv
Part 1 Introduction To Wxpython
Welcome to wxPython
3(26)
Getting started with wxPython
5(2)
Creating the bare-minimum wxPython program
7(5)
Importing wxPython
9(2)
Working with applications and frames
11(1)
Extending the bare-minimum wxPython program
12(3)
Creating the final hello.py program
15(2)
What can wxPython do?
17(2)
Why choose wxPython?
19(2)
Python programmers
19(1)
wxWidget users
20(1)
New users
20(1)
How wxPython works
21(6)
The Python language
21(1)
The wxWidgets toolkit
22(3)
Putting it together: the wxPython toolkit
25(2)
Summary
27(2)
Giving your wxPython program a solid foundation
29(27)
What do I need to know about the required objects?
30(1)
How do I create and use an application object?
31(4)
Creating a wx.App subclass
31(3)
Understanding the application object lifecycle
34(1)
How do I direct output from a wxPython program?
35(3)
Redirecting output
35(2)
Modifying the default redirect behavior
37(1)
How do I shut down my wxPython application?
38(1)
Managing a normal shutdown
38(1)
Managing an emergency shutdown
39(1)
How do I create and use the top-level window object?
39(8)
Working with wx.Frame
40(2)
Working with wxPython IDs
42(1)
Working with wx.Size and wx.Point
43(1)
Working with wx.Frame styles
44(3)
How do I add objects and subwindows to a frame?
47(4)
Adding widgets to a frame
47(2)
Adding a menubar, toolbar, or status bar to a frame
49(2)
How can I use common dialogs?
51(2)
What are some common errors with application objects and frames?
53(1)
Summary
54(2)
Working in an event-driven environment
56(27)
What terminology do I need to understand events?
57(1)
What is event-driven programming?
58(5)
Coding event handlers
60(1)
Designing for event-driven programs
61(1)
Event triggers
62(1)
How do I bind an event to a handler?
63(5)
Working with the wx.EvtHandler methods
65(3)
How are events processed by wxPython?
68(9)
Understanding the event handling process
69(6)
Using the Skip() method
75(2)
What other event properties are contained in the application object?
77(1)
How can I create my own events?
77(4)
Defining a custom event for a custom widget
78(3)
Summary
81(2)
Making wxPython easier to handle with PyCrust
83(33)
How do I interact with a wxPython program?
84(2)
What are the useful features of PyCrust?
86(9)
Autocompletion
87(1)
Calltips and parameter defaults
88(1)
Syntax highlighting
89(1)
Python help
90(1)
Command recall
91(1)
Cut and paste
92(1)
Standard shell environment
93(1)
Dynamic updating
94(1)
What do the PyCrust notebook tabs do?
95(4)
Namespace tab
95(2)
Display tab
97(1)
Calltip tab
97(1)
Session tab
98(1)
Dispatcher tab
98(1)
How can I wrap PyCrust around my wxPython application?
99(5)
What else is in the Py package?
104(8)
Working with the GUI programs
104(1)
Working with the support modules
105(7)
How can I use modules from the Py package in my wxPython programs?
112(3)
Summary
115(1)
Creating your blueprint
116(30)
How can refactoring help me improve my code?
117(9)
A refactoring example
118(3)
Starting to refactor
121(1)
More refactoring
122(4)
How do I keep the Model and View separate in my program?
126(14)
What is a Model-View-Controller system?
126(2)
A wxPython model: PyGridTableBase
128(8)
A custom model
136(4)
How do you unit-test a GUI program?
140(5)
The unittest module
140(1)
A unittest sample
141(2)
Testing user events
143(2)
Summary
145(1)
Working with the basic building blocks
146(37)
Drawing to the screen
148(7)
How do I draw on the screen?
148(7)
Adding window decorations
155(10)
How do I add and update a status bar?
155(3)
How do I include a submenu or checked menu?
158(3)
How do I include a toolbar?
161(4)
Getting standard information
165(5)
How do I use standard file dialogs?
165(4)
How do I use a standard color picker?
169(1)
Making the application look nice
170(11)
How do I lay out widgets?
170(8)
How do I build an about box?
178(2)
How do I build a splash screen?
180(1)
Summary
181(2)
Part 2 Essential Wxpython
183(208)
Working with the basic controls
185(39)
Displaying text
186(13)
How do I display static text?
186(3)
How can I get the user to enter text?
189(3)
How do I change the text without user input?
192(1)
How do I create a multi-line or styled text control?
193(3)
How do I create a font?
196(1)
Can I have styled text if my platform doesn't support rich text?
197(1)
What if my text control doesn't match my string?
198(1)
How do I respond to text events?
199(1)
Working with buttons
199(6)
How do I make a button?
200(1)
How do I make a button with a bitmap?
201(1)
How do I create a toggle button?
202(1)
What's a generic button, and why should I use one?
203(2)
Entering and displaying numbers
205(6)
How do I make a slider?
205(3)
How can I get those neat up/down arrow buttons?
208(2)
How can I make a progress bar?
210(1)
Giving the user choices
211(11)
How do I create a checkbox?
211(1)
How can I create a group of radio buttons?
212(4)
How can I create a list box?
216(3)
Can I combine a checkbox and a list box?
219(1)
What if I want a pull-down choice?
220(1)
Can I combine text entry and a list?
221(1)
Summary
222(2)
Putting widgets in frames
224(34)
The life of a frame
225(9)
How do I create a frame?
225(2)
What are some different frame styles?
227(3)
How do I create a frame with extra style information?
230(2)
What happens when I close a frame?
232(2)
Using frames
234(8)
What are the methods and properties of wx.Frame?
234(3)
How do I find a subwidget of a frame?
237(1)
How do I create a frame with a scrollbar?
238(4)
Alternative frame types
242(8)
How do I create an MDI frame?
242(2)
What's a mini-frame and why would I use it?
244(1)
How do I make a non-rectangular frame?
245(3)
How can I drag a frame without a title bar?
248(2)
Using splitter windows
250(6)
Creating a splitter window
250(1)
A splitter example
251(2)
Changing the appearance of the splitter
253(1)
Manipulating the splitter programmatically
254(1)
Responding to splitter events
255(1)
Summary
256(2)
Giving users choices with dialogs
258(35)
Working with modal dialogs
259(10)
How do I create a modal dialog?
259(2)
How do I create an alert box?
261(3)
How do I get short text from the user?
264(2)
How can I display a list of choices in a dialog?
266(1)
How can I display progress?
267(2)
Using standard dialogs
269(9)
How can I use a file picker?
269(4)
How can I use a font picker?
273(2)
How can I use a color picker?
275(2)
Can I allow the user to browse images?
277(1)
Creating a wizard
278(3)
Showing startup tips
281(1)
Using validators to manage data in a dialog
282(9)
How do I use a validator to ensure correct data?
282(4)
How do I use a validator to transfer data?
286(2)
How do I validate data as it is entered?
288(3)
Summary
291(2)
Creating and using wxPython menus
293(30)
Creating Menus
294(9)
How do I create a menu bar and attach it to a frame?
295(1)
How do I create a menu and attach it to the menu bar?
295(2)
How do I add items to a pull-down menu?
297(4)
How do I respond to a menu event?
301(2)
Working with menu items
303(10)
How do I find a specific menu item in a menu?
303(3)
How do I enable or disable a menu item?
306(1)
How do I associate a menu item with a keyboard shortcut?
307(4)
How do I create a toggle menu item with a checkbox or radio button?
311(2)
Sprucing up your menus
313(6)
How do I create a submenu?
313(2)
How do I create a pop-up menu?
315(2)
How can I create fancier menus?
317(2)
Usability guidelines for menus
319(2)
Keeping menus uniform in length
319(1)
Creating logical item groups
319(2)
Summary
321(2)
Placing widgets with sizers
323(33)
What's a sizer?
324(2)
Basic sizers with the grid sizer
326(11)
What is a grid sizer?
327(2)
How do you add or remove children from a sizer?
329(2)
How do sizers manage the size and alignment of their children?
331(3)
Can I specify a minimum size for my sizer or its children?
334(2)
How do sizers manage the border around each child?
336(1)
Using the other sizer types
337(13)
What's a flex grid sizer?
337(4)
What's a grid bag sizer?
341(4)
What's a box sizer?
345(4)
What's a static box sizer?
349(1)
Can I see a real-world example of sizers in action?
350(4)
Summary
354(2)
Manipulating basic graphical images
356(35)
Working with images
357(10)
How do I load images?
357(4)
What can I do with an image?
361(3)
How can I change cursors?
364(3)
Dealing with device contexts
367(14)
What is a device context, and how can I create one?
367(4)
How do I draw to a device context?
371(5)
How do I draw images to the context?
376(3)
How can I draw text to the context?
379(2)
Graphics manipulation
381(7)
How do I manage the foreground drawing pen?
381(3)
How do I manage the background drawing brush?
384(1)
How can I manage logical and physical device coordinates?
385(2)
What color names are predefined?
387(1)
Summary
388(3)
Part 3 Advanced Wxpython
391(154)
Building list controls and managing items
393(32)
Building a list control
394(6)
What is icon mode?
394(1)
What is small icon mode?
395(1)
What is list mode?
396(1)
What is report mode?
397(1)
How do I create a list control?
398(2)
Managing items in a list
400(5)
What is an image list and how do I add images to it?
400(2)
How can I add and delete items from a list?
402(3)
Responding to users
405(6)
How can I respond to a user selection in a list?
405(2)
How can I respond to a user selection in a column header?
407(4)
Editing and sorting list controls
411(9)
How can I edit a label?
411(2)
How can I sort my list?
413(3)
How can I learn more about list controls?
416(4)
Creating a virtual list control
420(3)
Summary
423(2)
Coordinating the grid control
425(35)
Creating your grid
426(6)
How do I create a simple grid?
426(3)
How do I create a grid with a grid table?
429(3)
Working with your grid
432(13)
How do I add and delete rows, columns, and cells?
432(1)
How do I manage the row and column headers of a grid?
433(3)
How can I manage the size of grid elements?
436(4)
How can I manage which cells are selected or visible?
440(2)
How do I change the color or font of a grid cell?
442(3)
Custom renderers and editors
445(10)
How do I use a custom cell renderer?
445(4)
How do I edit a cell?
449(1)
How do I use a custom cell editor?
450(5)
Capturing user events
455(3)
How can I capture user mouse selections?
455(2)
How can I capture user keyboard navigation?
457(1)
Summary
458(2)
Climbing the tree control
460(25)
Creating tree controls and adding items
461(4)
How do I add a root?
463(1)
How do I add more items to the tree?
463(1)
How do I manage items?
464(1)
What styles control the display of the tree control?
465(2)
Sorting elements of a tree control
467(1)
Controlling the image for each item
468(3)
Navigating the tree programmatically
471(1)
Managing the tree selection
472(1)
Controlling which items are visible
473(4)
Making a tree control user editable
477(1)
Responding to other user events from a tree control
478(2)
Using a tree list control
480(2)
Summary
482(3)
Incorporating HTML into your application
485(19)
Displaying HTML
486(4)
How can I display HTML in a wxPython window?
486(2)
How can I display HTML from a file or URL?
488(2)
Manipulating the HTML window
490(6)
How can I respond to a user click on an active link?
490(1)
How can I change an HTML window programmatically?
491(2)
How can I display the page title in a frame's title bar?
493(2)
How can I print an HTML page?
495(1)
Extending the HTML window
496(7)
How does the HTML parser work?
496(2)
How can I add support for new tags?
498(3)
How can I support other file formats?
501(1)
How can I get a more fully featured HTML Widget?
502(1)
Summary
503(1)
The wxPython printing framework
504(17)
How do I print in wxPython?
505(7)
Understanding the printout lifecycle
506(1)
Print framework in action
507(4)
Working with wx.Printout methods
511(1)
How do I display the print dialog?
512(3)
Creating a print dialog
512(3)
How do I display the page setup dialog?
515(3)
Creating a page setup dialog
515(1)
Working with page setup properties
516(2)
How do I print something?
518(1)
How can I perform a print preview?
519(1)
Summary
520(1)
Using other wxPython functionality
521(24)
Putting objects on the clipboard
522(5)
Getting data in the clipboard
522(1)
Manipulating data in the clipboard
523(1)
Retrieving text data from the clipboard
524(1)
The clipboard in action
524(2)
Passing other data formats
526(1)
Being the source of a drag and drop
527(3)
Dragging in action
529(1)
Being the target of a drag and drop
530(4)
Using your drop target
531(2)
Dropping in action
533(1)
Transferring custom objects
534(2)
Transferring a custom data object
534(1)
Retrieving a custom object
535(1)
Transferring an object in multiple formats
535(1)
Setting timed events using wx.Timer
536(3)
Generating EVT_TIMER events
536(3)
Learning other timer uses
539(1)
Creating a multithreaded wxPython application
539(5)
Working with the global function wx.CallAfter()
540(3)
Managing thread communication with the queue object
543(1)
Developing your own solution
543(1)
Summary
544(1)
index 545

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Rewards Program