13.07.2015 Views

The wxPython tutorial

The wxPython tutorial

The wxPython tutorial

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>wxPython</strong> dialogshttp://www.zetcode.com/wxpython/dialogs/Home ContentsPython IDEFaster, Easier Python Development Editor,Debugger, Browser, and more<strong>wxPython</strong> dialogsMessage Box for ASP.NETModal message box/dialog for Web Fullycustomizable, VB & C# sampleDialog windows or dialogs are an indispensable part of most modernGUI applications. A dialog is defined as a conversation between twoor more persons. In a computer application a dialog is a windowwhich is used to "talk" to the application. A dialog is used to inputdata, modify data, change the application settings etc. Dialogs areimportant means of communication between a user and a computerprogram.A Simple message boxA message box provides short information to the user. A goodexample is a cd burning application. When a cd is finished burning, amessage box pops up.#!/usr/bin/python# message.pyimport wxclass MessageDialog(wx.Frame):def __init__(self, parent, id, title):wx.Frame.__init__(self, parent, id, title)wx.FutureCall(5000, self.ShowMessage)self.Centre()self.Show(True)def ShowMessage(self):wx.MessageBox('Download completed', 'Info')app = wx.App()MessageDialog(None, -1, 'MessageDialog')app.MainLoop()wx.FutureCall(5000, self.ShowMessage)wx.FutureCall calls a method after 5 seconds. <strong>The</strong> first parameter isa time value, after which a given method is called. <strong>The</strong> parameter isin milliseconds. <strong>The</strong> second parameter is a method to be called.1 de 11 27/04/2008 1:04

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

Saved successfully!

Ooh no, something went wrong!