Size: 7826
Comment:
|
Size: 7817
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 34: | Line 34: |
We’ve benefited a great deal from the generosity of programmers world-wide in creating the technologies used in this book. First on that list is the crew who developed the wxWidgets foundation of wxPython: Julian Smart, Vadim Zeitlin, Robert Roebling, and the rest of the core wxWidgets team, as well as many contributors. Of course, without Guido van Rossum and other members of the Python language development team, there would be no “Python” in “wxPython.” A large part of this book was written using the jEdit text editor and the images were manipulated using the GIMP. | We’ve benefited a great deal from the generosity of programmers world-wide in creating the technologies used in this book. First on that list is the crew who developed the wxWidgets foundation of wxPython: Julian Smart, Vadim Zeitlin, Robert Roebling, and the rest of the core wxWidgets team, as well as many contributors. Of course, without Guido van Rossum and other members of the Python language development team, there would be no “Python” in “wxPython.” A large part of this book was written using the jEdit text editor and the images were manipulated using the GIMP. |
Line 36: | Line 36: |
Thanks also to the many reviewers who looked at the manuscript in its vari-ous stages of development and added their valuable insight along the way. They helped make this a better book: Alex Martelli, Dave Brueck, Christopher Bailey, xxii Mike Stok, Jean Baltus, Thomas Palmer, Jack Herrington, Peter Damoc, Nick Coghlan, Pim Van Heuven, John Paulson, Ian Brown, Stefan Neis, Chris Mellon, Kevin Ollivier, and Doug Tillman. Special thanks to Clint Howarth who was our technical proofreader. |
Thanks also to the many reviewers who looked at the manuscript in its vari-ous stages of development and added their valuable insight along the way. They helped make this a better book: Alex Martelli, Dave Brueck, Christopher Bailey, Mike Stok, Jean Baltus, Thomas Palmer, Jack Herrington, Peter Damoc, Nick Coghlan, Pim Van Heuven, John Paulson, Ian Brown, Stefan Neis, Chris Mellon, Kevin Ollivier, and Doug Tillman. Special thanks to Clint Howarth who was our technical proofreader. |
活学活用wxPython
前言
关于 Harri Pasanen 和 Robin Dunn 以及wxPython的传奇故事确切的开始时间是1995年。本书的合著者之一,Robin 写下了下面这段关于wxPython 的文字,而我们决定让故事由参与者自己来讲述,而不是籍由旁人加以引述:
- 1995年,我所进行的一个项目需要在HP-UX系统上部署一个图形用户界面,但我的老板却同时希望在几周后的一个内部展示会上通过Windows3.1掌上电脑来进行一些演示。因此,我开始搜寻跨平台的C++ GUI开发包来进行原型开发。在那个时候,因为没有Google,要完成这样的工作实非易事。但我还是发现了一些商业化的可选开发包(今天已经无一幸存)和大量的免费开发包。
当我正在评估分析哪个免费开发包符合当前的紧急需求,并决定哪个商业产品能够满足我们的长期需求时,我偶然看到了 wxWidgets 网站的术语“Python绑定”(这里“绑定”一词指Python语言和wxWidgets开发包之间的联系。)由于对如何将软件开发包“绑定”到爬虫动物(在此之前,我从来没有听说过Python语言)充满好奇,我顺着这个链接一个个的点击,直到看到“Python 1.2 入门文档”。三个小时后,我从当地的C++倡导者变成了Python的传播者,不断叨扰周边的开发者,向他们展示我的最新发现。
我开始和芬兰的Harri Pasanen一起致力于推进Python和wxWidgets的绑定(在Edward Zimmerman的协助下,最终形成了众所周知的wxPython 0.2),而不是继续我的原型开发。发行声明的邮件列表归档于[http://www.google.com/groups?selm=PA.95Jul27032244%40ok.tekla.fi&oe=UTF-8] 我们使它的功能强大到多足以让我能够用Python为老板建造一个原型。但是wxPython的维护和改进工作却是一个噩梦,因为每件事情(包括C++扩展模块代码、Python代理模块、编译系统等等)都是手工完成的,wxWidget的一点点改进都会导致要修改多处wxPython代码,以确保wxPython得到改进或修订。当代码增加上几万行时,这种工作方式变得非常笨拙和琐碎。另一个客观事实是:缺乏一个中心源代码库(那是SourceForge出现之前的时代),因此我们不得不通过电子邮件互相发送代码更新,你可以想象得到这其中的难度。
大约在此时,我不得不“真正”开始主项目的开发了。在我的控制下,一些项目开发者们一起进行设计会晤、设定开发期限,从眼中的灵光一现开始完成一个完整的项目开发。我发现自己又完全回到了C++世界,尽管我可以用Python来进行一些编译及项目的测试脚本。Harri 也无法在上面投入任何时间了,因此wxPython的开发变得比“爬行”还慢了,有时甚至进入了停滞状态。
1997年,我发现了SWIG(简单封装和接口产生器),并意识到它可以帮助我们解决wxPython项目中困扰我们已久的所有维护问题。在三、四周的业余时间里,通过使用SWIG,我几乎将wxPython的全部重新实现了一遍,而在此前用手工完成这项工作耗用了我几周的完整时间以及Harri几个月的部分时间。在转向其他项目一段时间后,我发现wxWidgets 2.0正在积极开发中,而且有了一个全新的架构,因此我不得不重新完成这项工作。但这次,新的架构简化了大量的工作,我仅用了一周的业余时间就完成了!因此,在1998年夏天,第一个“现代版本”的wxPython顺利发布,并从此一直处于活跃开发状态。第一份声明归档与此: [http://groups.yahoo.com/group/python-announce-list/message/95] 正如他们所说的,剩下的部分就是传奇故事了。
必须特别说明的是:SWIG 使得我能够轻松创建和维护成千上百行的代码,因此wxPython的多种功能特性必须感谢David Beazley以及其他项目参与者对SWIG的贡献。通过此书,我们希望能够与您分享对于wxPython的热情,在轻松开发图形用户界面应用程序方面,它是真正的独一无二的开发包。我们写作的初衷是不但为初学者,也为专业人员建造一项有用的资源。
acknowledgments
Our work on this book has been aided by a number of people, in ways both obvious and subtle.
Patrick O’Brien was instrumental in getting this project off the ground and Marjan Bace, our publisher at Manning Publications, gave us the chance to make it happen. Jackie Carter was our first editor at Manning and Lianna Wlasiuk came in at a crucial juncture, and, like a great bullpen pitcher, earned the save. We would like to thank our production team at Manning and every-one who worked behind the scenes on the book, especially our copyeditor Elizabeth Martin and our typesetter Denis Dalinnik. Big thanks also to our agent Laura Lewin for her help and understanding.
We’ve benefited a great deal from the generosity of programmers world-wide in creating the technologies used in this book. First on that list is the crew who developed the wxWidgets foundation of wxPython: Julian Smart, Vadim Zeitlin, Robert Roebling, and the rest of the core wxWidgets team, as well as many contributors. Of course, without Guido van Rossum and other members of the Python language development team, there would be no “Python” in “wxPython.” A large part of this book was written using the jEdit text editor and the images were manipulated using the GIMP.
Thanks also to the many reviewers who looked at the manuscript in its vari-ous stages of development and added their valuable insight along the way. They helped make this a better book: Alex Martelli, Dave Brueck, Christopher Bailey, Mike Stok, Jean Baltus, Thomas Palmer, Jack Herrington, Peter Damoc, Nick Coghlan, Pim Van Heuven, John Paulson, Ian Brown, Stefan Neis, Chris Mellon, Kevin Ollivier, and Doug Tillman. Special thanks to Clint Howarth who was our technical proofreader.
NOEL RAPPIN My wife, Erin, makes my life better every day. Thank you for your strength, your intelligence, and your love. I also want to thank my parents Donna and Donnie and my sister Michelle for supporting me fully and com-pletely. Matt Cohen helped this effort by entertaining me via IM while I was try-ing to write. Finally, I want to thank my daughter Emma, who is now old enough to be excited to see her name in a book, and my son Elliot, in anticipation of the day he will also be glad to see his name.
ROBIN DUNN I’d like to thank my wife, Malaura, and my children, Jordyn, Myka, Samuel, and Christian, for their patience, understanding, and love. You make it worth the effort to get past all the difficulties of life. I’d also like to thank the many wonderful members of the wxPython user community whose praise and excitement have helped me to stay motivated and have helped me to take wxPython from an interesting toy to a very useful tool that thousands of develop-ers all around the world love and depend upon. And finally, many thanks go to Mitch Kapor, John Anderson, David Surovell, and others at the Open Source Applications Foundation for believing in the Open Source concept, the poten-tials of wxPython, and especially for believing in my capabilities and funding my work on wxPython for several years.