Commit | Line | Data |
---|---|---|
f541d829 RD |
1 | |
2 | import wx | |
3 | ||
4 | #---------------------------------------------------------------------- | |
5 | ||
6 | class TestPanel(wx.Panel): | |
7 | def __init__(self, parent, log): | |
8 | self.log = log | |
9 | wx.Panel.__init__(self, parent, -1) | |
10 | ||
11 | b = wx.Button(self, -1, "Show a wx.AboutBox", (50,50)) | |
12 | self.Bind(wx.EVT_BUTTON, self.OnButton, b) | |
13 | ||
14 | ||
15 | def OnButton(self, evt): | |
16 | # First we create and fill the info object | |
17 | info = wx.AboutDialogInfo() | |
18 | info.Name = "Hello World" | |
19 | info.Version = "1.2.3" | |
20 | info.Copyright = "(C) 2006 Programmers and Coders Everywhere" | |
21 | info.Description = \ | |
22 | "A \"hello world\" program is a software program that prints out "\ | |
23 | "\"Hello world!\" on a display device. It is used in many introductory "\ | |
24 | "tutorials for teaching a programming language. Such a program is "\ | |
25 | "typically one of the simplest programs possible in a computer language. "\ | |
26 | "A \"hello world\" program can be a useful sanity test to make sure that "\ | |
27 | "a language's compiler, development environment, and run-time environment "\ | |
28 | "are correctly installed." | |
29 | info.WebSite = ("http://en.wikipedia.org/wiki/Hello_world", "Hello World home page") | |
30 | info.Developers = [ "Joe Programmer", | |
31 | "Jane Coder", | |
32 | "Vippy the Mascot" ] | |
33 | ||
34 | # Then we call wx.AboutBox giving it that info object | |
35 | wx.AboutBox(info) | |
36 | ||
37 | ||
38 | #---------------------------------------------------------------------- | |
39 | ||
40 | def runTest(frame, nb, log): | |
41 | win = TestPanel(nb, log) | |
42 | return win | |
43 | ||
44 | #---------------------------------------------------------------------- | |
45 | ||
46 | ||
47 | ||
48 | overview = """<html><body> | |
49 | <h2><center>wx.AboutBox</center></h2> | |
50 | ||
51 | This function shows the native standard about dialog containing the | |
52 | information specified in info. If the current platform has a native | |
53 | about dialog which is capable of showing all the fields in info, the | |
54 | native dialog is used, otherwise the function falls back to the | |
55 | generic wxWidgets version of the dialog. | |
56 | ||
57 | </body></html> | |
58 | """ | |
59 | ||
60 | ||
61 | ||
62 | if __name__ == '__main__': | |
63 | import sys,os | |
64 | import run | |
65 | run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:]) | |
66 |