13.07.2015 Views

The wxPython tutorial

The wxPython tutorial

The wxPython tutorial

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>wxPython</strong> dialogshttp://www.zetcode.com/wxpython/dialogs/under the terms of the GNU General Public License as published by the Free Software Foueither version 2 of the License, or (at your option) any later version.File Hunter is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTYwithout even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSSee the GNU General Public License for more details. You should have received a copy ofthe GNU General Public License along with File Hunter; if not, write tothe Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307info = wx.AboutDialogInfo()info.SetIcon(wx.Icon('icons/hunter.png', wx.BITMAP_TYPE_PNG))info.SetName('File Hunter')info.SetVersion('1.0')info.SetDescription(description)info.SetCopyright('(C) 2007 jan bodnar')info.SetWebSite('http://www.zetcode.com')info.SetLicence(licence)info.AddDeveloper('jan bodnar')info.AddDocWriter('jan bodnar')info.AddArtist('<strong>The</strong> Tango crew')info.AddTranslator('jan bodnar')wx.AboutBox(info)app = wx.App()AboutDialogBox(None, -1, 'About dialog box')app.MainLoop()description = """File Hunter is an advanced file manager for the Unix operatingsystem. Features include powerful built-in editor, advanced search capabilities,powerful batch renaming, file comparison, extensive archive handling and more."""It is not the best idea to put too much text into the code of theapplication. I don't want to make the example too complex, so I putall the text into the code. But in real world programs, the text shouldbe placed separately inside a file. It helps us with the maintenace ofour application. For example, if we want to translate our applicationto other languages.info = wx.AboutDialogInfo()<strong>The</strong> first thing to do is to create a wx.AboutDialogInfo object. <strong>The</strong>constructor is empty. It does not taky any parameters.info.SetIcon(wx.Icon('icons/hunter.png', wx.BITMAP_TYPE_PNG))info.SetName('File Hunter')info.SetVersion('1.0')info.SetDescription(description)info.SetCopyright('(C) 2007 jan bodnar')7 de 11 27/04/2008 1:04

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!