]> git.saurik.com Git - wxWidgets.git/blame - wxPython/demo/Main.py
More XRCed updates from Roman
[wxWidgets.git] / wxPython / demo / Main.py
CommitLineData
cf694132
RD
1#!/bin/env python
2#----------------------------------------------------------------------------
3# Name: Main.py
4# Purpose: Testing lots of stuff, controls, window types, etc.
5#
f6bcfd97 6# Author: Robin Dunn
cf694132 7#
f6bcfd97 8# Created: A long time ago, in a galaxy far, far away...
cf694132
RD
9# RCS-ID: $Id$
10# Copyright: (c) 1999 by Total Control Software
11# Licence: wxWindows license
12#----------------------------------------------------------------------------
13
6c5ae2d2 14import sys, os, time, string
cf694132 15from wxPython.wx import *
f6bcfd97 16from wxPython.html import wxHtmlWindow
cf694132 17
96bfd053
RD
18import images
19
cf694132
RD
20#---------------------------------------------------------------------------
21
22
23_treeList = [
68320e40 24 ('New since last release', ['wxGenericDirCtrl',
f74ff5ef 25 'wxImageFromStream',
96de41c2 26 'RowColSizer',
f6bcfd97 27 ]),
e395c057 28
6d19860f 29 ('Windows', ['wxFrame', 'wxDialog', 'wxMiniFrame',
6d19860f
RD
30 'wxGrid', 'wxSashWindow',
31 'wxScrolledWindow', 'wxSplitterWindow',
32 'wxStatusBar', 'wxNotebook',
33 'wxHtmlWindow',
0122b7e3 34 'wxStyledTextCtrl_1', 'wxStyledTextCtrl_2',
a57d56d6 35 'wxPopupWindow',
ebf4302c 36 'wxDynamicSashWindow',
0122b7e3 37 ]),
cf694132
RD
38
39 ('Common Dialogs', ['wxColourDialog', 'wxDirDialog', 'wxFileDialog',
40 'wxSingleChoiceDialog', 'wxTextEntryDialog',
41 'wxFontDialog', 'wxPageSetupDialog', 'wxPrintDialog',
0122b7e3
RD
42 'wxMessageDialog', 'wxProgressDialog', 'wxFindReplaceDialog',
43 ]),
cf694132
RD
44
45 ('Controls', ['wxButton', 'wxCheckBox', 'wxCheckListBox', 'wxChoice',
68320e40
RD
46 'wxComboBox', 'wxGauge', 'wxListBox', 'wxListCtrl', 'VirtualListCtrl',
47 'wxTextCtrl',
f6bcfd97
BP
48 'wxTreeCtrl', 'wxSpinButton', 'wxSpinCtrl', 'wxStaticText',
49 'wxStaticBitmap', 'wxRadioBox', 'wxSlider', 'wxToolBar',
d1679124 50 'wxCalendarCtrl', 'wxToggleButton',
950e7faf 51 'wxEditableListBox', 'wxLEDNumberCtrl',
6999b0d8 52 ]),
cf694132 53
96de41c2
RD
54 ('Window Layout', ['wxLayoutConstraints', 'LayoutAnchors', 'Sizers', 'XML_Resource',
55 'RowColSizer',
56 ]),
cf694132 57
846ec2f9
RD
58 ('Miscellaneous', [ 'DragAndDrop', 'CustomDragAndDrop', 'URLDragAndDrop',
59 'FontEnumerator',
b1462dfa 60 'wxTimer', 'wxValidator', 'wxGLCanvas', 'DialogUnits',
9b3d3bc4 61 'wxImage', 'wxMask', 'PrintFramework', 'wxOGL',
f6bcfd97
BP
62 'PythonEvents', 'Threads',
63 'ActiveXWrapper_Acrobat', 'ActiveXWrapper_IE',
493f1553 64 'wxDragImage', "wxProcess", "FancyText", "OOR", "wxWave",
b37c7e1d 65 'wxJoystick', 'DrawXXXList', 'ErrorDialogs', 'wxMimeTypesManager',
68320e40 66 'ContextHelp', 'SplitTree',
f6bcfd97 67 ]),
cf694132 68
e0473f5f 69 ('wxPython Library', ['Layoutf', 'wxScrolledMessageDialog',
f0261a72 70 'wxMultipleChoiceDialog', 'wxPlotCanvas', 'wxFloatBar',
c7e7022c 71 'wxCalendar', 'wxMVCTree', 'wxVTKRenderWindow',
c368d904 72 'FileBrowseButton', 'GenericButtons', 'wxEditor',
c7e7022c 73 'ColourSelect', 'ImageBrowser',
68320e40
RD
74 'infoframe', 'ColourDB', 'PyCrust', 'PyCrustWithFilling',
75 'TablePrint',
729f4276 76 'wxRightTextCtrl',
c368d904 77 ]),
cf694132 78
611dc22c
RD
79 ('Cool Contribs', ['pyTree', 'hangman',
80 #'SlashDot',
81 'XMLtreeview'
82 ]),
cf694132
RD
83
84 ]
85
86#---------------------------------------------------------------------------
87
76bfdc78
RD
88class MyLog(wxPyLog):
89 def __init__(self, textCtrl, logTime=0):
90 wxPyLog.__init__(self)
91 self.tc = textCtrl
92 self.logTime = logTime
93
94 def DoLogString(self, message, timeStamp):
95 if self.logTime:
96 message = time.strftime("%X", time.localtime(timeStamp)) + \
97 ": " + message
98 self.tc.AppendText(message + '\n')
99
100
6c5ae2d2
RD
101#---------------------------------------------------------------------------
102
103def opj(path):
104 """Convert paths to the platform-specific separator"""
105 return apply(os.path.join, tuple(string.split(path, '/')))
106
107
76bfdc78
RD
108#---------------------------------------------------------------------------
109
cf694132 110class wxPythonDemo(wxFrame):
c368d904 111
cf694132 112 def __init__(self, parent, id, title):
f6bcfd97
BP
113 wxFrame.__init__(self, parent, -1, title, size = (800, 600),
114 style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE)
2f90df85 115
694759cf 116 self.cwd = os.getcwd()
3ca6a5f0 117 self.curOverview = ""
694759cf 118
afb810d9 119 icon = images.getMondrianIcon()
96bfd053 120 self.SetIcon(icon)
c368d904 121
96bfd053 122 if wxPlatform == '__WXMSW__':
c368d904
RD
123 # setup a taskbar icon, and catch some events from it
124 self.tbicon = wxTaskBarIcon()
125 self.tbicon.SetIcon(icon, "wxPython Demo")
126 EVT_TASKBAR_LEFT_DCLICK(self.tbicon, self.OnTaskBarActivate)
127 EVT_TASKBAR_RIGHT_UP(self.tbicon, self.OnTaskBarMenu)
128 EVT_MENU(self.tbicon, self.TBMENU_RESTORE, self.OnTaskBarActivate)
129 EVT_MENU(self.tbicon, self.TBMENU_CLOSE, self.OnTaskBarClose)
130
cf694132
RD
131
132 self.otherWin = None
133 EVT_IDLE(self, self.OnIdle)
f6bcfd97 134 EVT_CLOSE(self, self.OnCloseWindow)
f3d9dc1d
RD
135 EVT_ICONIZE(self, self.OnIconfiy)
136 EVT_MAXIMIZE(self, self.OnMaximize)
cf694132
RD
137
138 self.Centre(wxBOTH)
139 self.CreateStatusBar(1, wxST_SIZEGRIP)
5a7823f5 140
f6bcfd97
BP
141 splitter = wxSplitterWindow(self, -1, style=wxNO_3D|wxSP_3D)
142 splitter2 = wxSplitterWindow(splitter, -1, style=wxNO_3D|wxSP_3D)
5a7823f5 143
d56cebe7
RD
144 def EmptyHandler(evt): pass
145 EVT_ERASE_BACKGROUND(splitter, EmptyHandler)
146 EVT_ERASE_BACKGROUND(splitter2, EmptyHandler)
cf694132 147
b1cfebd9 148 # Prevent TreeCtrl from displaying all items after destruction when true
cf694132
RD
149 self.dying = false
150
151 # Make a File menu
152 self.mainmenu = wxMenuBar()
153 menu = wxMenu()
2f90df85 154 exitID = wxNewId()
f0261a72 155 menu.Append(exitID, 'E&xit\tAlt-X', 'Get the heck outta here!')
2f90df85 156 EVT_MENU(self, exitID, self.OnFileExit)
cf694132
RD
157 self.mainmenu.Append(menu, '&File')
158
ec3e670f
RD
159 # Make a Demo menu
160 menu = wxMenu()
161 for item in _treeList:
162 submenu = wxMenu()
163 for childItem in item[1]:
164 mID = wxNewId()
165 submenu.Append(mID, childItem)
166 EVT_MENU(self, mID, self.OnDemoMenu)
167 menu.AppendMenu(wxNewId(), item[0], submenu)
168 self.mainmenu.Append(menu, '&Demo')
169
170
cf694132 171 # Make a Help menu
2f90df85 172 helpID = wxNewId()
cf694132 173 menu = wxMenu()
2f90df85
RD
174 menu.Append(helpID, '&About\tCtrl-H', 'wxPython RULES!!!')
175 EVT_MENU(self, helpID, self.OnHelpAbout)
cf694132
RD
176 self.mainmenu.Append(menu, '&Help')
177 self.SetMenuBar(self.mainmenu)
178
2f90df85 179 # set the menu accellerator table...
f0261a72 180 aTable = wxAcceleratorTable([(wxACCEL_ALT, ord('X'), exitID),
2f90df85
RD
181 (wxACCEL_CTRL, ord('H'), helpID)])
182 self.SetAcceleratorTable(aTable)
183
bb0054cd 184
cf694132 185 # Create a TreeCtrl
f6bcfd97
BP
186 tID = wxNewId()
187 self.treeMap = {}
188 self.tree = wxTreeCtrl(splitter, tID,
189 style=wxTR_HAS_BUTTONS |
190 wxTR_EDIT_LABELS |
afb810d9
RD
191 wxTR_HAS_VARIABLE_ROW_HEIGHT)
192
f6bcfd97
BP
193 #self.tree.SetBackgroundColour(wxNamedColour("Pink"))
194 root = self.tree.AddRoot("Overview")
195 firstChild = None
196 for item in _treeList:
197 child = self.tree.AppendItem(root, item[0])
198 if not firstChild: firstChild = child
199 for childItem in item[1]:
200 theDemo = self.tree.AppendItem(child, childItem)
201 self.treeMap[childItem] = theDemo
202
203 self.tree.Expand(root)
204 self.tree.Expand(firstChild)
205 EVT_TREE_ITEM_EXPANDED (self.tree, tID, self.OnItemExpanded)
206 EVT_TREE_ITEM_COLLAPSED (self.tree, tID, self.OnItemCollapsed)
207 EVT_TREE_SEL_CHANGED (self.tree, tID, self.OnSelChanged)
208 EVT_LEFT_DOWN (self.tree, self.OnTreeLeftDown)
cf694132 209
cf694132 210 # Create a Notebook
d56cebe7 211 self.nb = wxNotebook(splitter2, -1, style=wxCLIP_CHILDREN)
cf694132 212
c368d904
RD
213 # Set up a wxHtmlWindow on the Overview Notebook page
214 # we put it in a panel first because there seems to be a
215 # refresh bug of some sort (wxGTK) when it is directly in
216 # the notebook...
217 if 0: # the old way
218 self.ovr = wxHtmlWindow(self.nb, -1, size=(400, 400))
219 self.nb.AddPage(self.ovr, "Overview")
220
e87269a7 221 else: # hopefully I can remove this hacky code soon, see bug #216861
d56cebe7 222 panel = wxPanel(self.nb, -1, style=wxCLIP_CHILDREN)
c368d904
RD
223 self.ovr = wxHtmlWindow(panel, -1, size=(400, 400))
224 self.nb.AddPage(panel, "Overview")
225
226 def OnOvrSize(evt, ovr=self.ovr):
227 ovr.SetSize(evt.GetSize())
228
229 EVT_SIZE(panel, OnOvrSize)
d56cebe7
RD
230 EVT_ERASE_BACKGROUND(panel, EmptyHandler)
231
c368d904
RD
232
233 self.SetOverview("Overview", overview)
cf694132
RD
234
235
236 # Set up a TextCtrl on the Demo Code Notebook page
efc5f224
RD
237 self.txt = wxTextCtrl(self.nb, -1,
238 style = wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL)
cf694132
RD
239 self.nb.AddPage(self.txt, "Demo Code")
240
241
cf694132 242 # Set up a log on the View Log Notebook page
f6bcfd97 243 self.log = wxTextCtrl(splitter2, -1,
efc5f224 244 style = wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL)
f6bcfd97 245 # Set the wxWindows log target to be this textctrl
76bfdc78
RD
246 #wxLog_SetActiveTarget(wxLogTextCtrl(self.log))
247 wxLog_SetActiveTarget(MyLog(self.log))
cf694132
RD
248
249
5a7823f5 250
f6bcfd97 251 self.Show(true)
5a7823f5 252
f6bcfd97
BP
253 # add the windows to the splitter and split it.
254 splitter2.SplitHorizontally(self.nb, self.log)
f6bcfd97 255 splitter.SplitVertically(self.tree, splitter2)
afb810d9 256
f6bcfd97
BP
257 splitter.SetSashPosition(180, true)
258 splitter.SetMinimumPaneSize(20)
afb810d9
RD
259 splitter2.SetSashPosition(450, true)
260 splitter2.SetMinimumPaneSize(20)
261
cf694132 262
cf694132 263
bb0054cd
RD
264 # select initial items
265 self.nb.SetSelection(0)
f6bcfd97 266 self.tree.SelectItem(root)
ec3e670f
RD
267
268 if len(sys.argv) == 2:
269 try:
270 selectedDemo = self.treeMap[sys.argv[1]]
271 except:
272 selectedDemo = None
f6bcfd97 273 if selectedDemo:
ec3e670f
RD
274 self.tree.SelectItem(selectedDemo)
275 self.tree.EnsureVisible(selectedDemo)
276
bb0054cd 277
f6bcfd97 278 wxLogMessage('window handle: %s' % self.GetHandle())
2abc0a0f
RD
279
280
cf694132
RD
281 #---------------------------------------------
282 def WriteText(self, text):
f6bcfd97
BP
283 if text[-1:] == '\n':
284 text = text[:-1]
285 wxLogMessage(text)
286
cf694132
RD
287
288 def write(self, txt):
289 self.WriteText(txt)
290
291 #---------------------------------------------
292 def OnItemExpanded(self, event):
293 item = event.GetItem()
f6bcfd97 294 wxLogMessage("OnItemExpanded: %s" % self.tree.GetItemText(item))
c368d904 295 event.Skip()
cf694132
RD
296
297 #---------------------------------------------
298 def OnItemCollapsed(self, event):
299 item = event.GetItem()
f6bcfd97 300 wxLogMessage("OnItemCollapsed: %s" % self.tree.GetItemText(item))
c368d904 301 event.Skip()
f6bcfd97
BP
302
303 #---------------------------------------------
304 def OnTreeLeftDown(self, event):
305 pt = event.GetPosition();
306 item, flags = self.tree.HitTest(pt)
307 if item == self.tree.GetSelection():
308 self.SetOverview(self.tree.GetItemText(item), self.curOverview)
185d7c3e 309 event.Skip()
cf694132
RD
310
311 #---------------------------------------------
312 def OnSelChanged(self, event):
313 if self.dying:
314 return
315
5a7823f5
RD
316 item = event.GetItem()
317 itemText = self.tree.GetItemText(item)
318 self.RunDemo(itemText)
319
320
321 #---------------------------------------------
322 def RunDemo(self, itemText):
694759cf 323 os.chdir(self.cwd)
cf694132
RD
324 if self.nb.GetPageCount() == 3:
325 if self.nb.GetSelection() == 2:
326 self.nb.SetSelection(0)
327 self.nb.DeletePage(2)
328
cf694132
RD
329 if itemText == 'Overview':
330 self.GetDemoFile('Main.py')
331 self.SetOverview('Overview', overview)
cf694132 332 self.nb.Refresh();
e91a9dfc 333 self.window = None
cf694132
RD
334
335 else:
336 if os.path.exists(itemText + '.py'):
9d8bd15f 337 wxBeginBusyCursor()
f6bcfd97
BP
338 wxLogMessage("Running demo %s.py..." % itemText)
339 try:
340 self.GetDemoFile(itemText + '.py')
341 module = __import__(itemText, globals())
342 self.SetOverview(itemText, module.overview)
343 finally:
344 wxEndBusyCursor()
cf694132
RD
345
346 # in case runTest is modal, make sure things look right...
347 self.nb.Refresh();
348 wxYield()
349
f6bcfd97 350 self.window = module.runTest(self, self.nb, self) ###
e91a9dfc
RD
351 if self.window:
352 self.nb.AddPage(self.window, 'Demo')
dcd38683 353 wxYield()
cf694132 354 self.nb.SetSelection(2)
cf694132
RD
355
356 else:
f6bcfd97 357 self.ovr.SetPage("")
cf694132 358 self.txt.Clear()
e91a9dfc 359 self.window = None
cf694132 360
2f90df85 361
cf694132
RD
362
363 #---------------------------------------------
364 # Get the Demo files
365 def GetDemoFile(self, filename):
366 self.txt.Clear()
bb0054cd
RD
367 try:
368 self.txt.SetValue(open(filename).read())
8bf5d46e 369 except IOError:
cf694132
RD
370 self.txt.WriteText("Cannot open %s file." % filename)
371
372 self.txt.SetInsertionPoint(0)
373 self.txt.ShowPosition(0)
374
375 #---------------------------------------------
376 def SetOverview(self, name, text):
f6bcfd97
BP
377 self.curOverview = text
378 lead = text[:6]
379 if lead != '<html>' and lead != '<HTML>':
380 text = string.join(string.split(text, '\n'), '<br>')
f6bcfd97 381 self.ovr.SetPage(text)
cf694132 382 self.nb.SetPageText(0, name)
cf694132
RD
383
384 #---------------------------------------------
385 # Menu methods
c368d904 386 def OnFileExit(self, *event):
cf694132
RD
387 self.Close()
388
389
390 def OnHelpAbout(self, event):
e166644c 391 from About import MyAboutBox
ec3e670f 392 about = MyAboutBox(self)
cf694132
RD
393 about.ShowModal()
394 about.Destroy()
395
396
397 #---------------------------------------------
398 def OnCloseWindow(self, event):
399 self.dying = true
e91a9dfc 400 self.window = None
26197023 401 self.mainmenu = None
c368d904
RD
402 if hasattr(self, "tbicon"):
403 del self.tbicon
cf694132
RD
404 self.Destroy()
405
c368d904 406
cf694132
RD
407 #---------------------------------------------
408 def OnIdle(self, event):
409 if self.otherWin:
410 self.otherWin.Raise()
e91a9dfc 411 self.window = self.otherWin
cf694132
RD
412 self.otherWin = None
413
ec3e670f
RD
414 #---------------------------------------------
415 def OnDemoMenu(self, event):
f6bcfd97
BP
416 try:
417 selectedDemo = self.treeMap[self.mainmenu.GetLabel(event.GetId())]
418 except:
419 selectedDemo = None
420 if selectedDemo:
421 self.tree.SelectItem(selectedDemo)
422 self.tree.EnsureVisible(selectedDemo)
ec3e670f 423
c368d904
RD
424
425 #---------------------------------------------
426 def OnTaskBarActivate(self, evt):
427 if self.IsIconized():
428 self.Iconize(false)
429 if not self.IsShown():
430 self.Show(true)
431 self.Raise()
432
433 #---------------------------------------------
434
435 TBMENU_RESTORE = 1000
436 TBMENU_CLOSE = 1001
437
438 def OnTaskBarMenu(self, evt):
439 menu = wxMenu()
440 menu.Append(self.TBMENU_RESTORE, "Restore wxPython Demo")
441 menu.Append(self.TBMENU_CLOSE, "Close")
442 self.tbicon.PopupMenu(menu)
443 menu.Destroy()
444
445 #---------------------------------------------
446 def OnTaskBarClose(self, evt):
447 self.Close()
448
449 # because of the way wxTaskBarIcon.PopupMenu is implemented we have to
450 # prod the main idle handler a bit to get the window to actually close
451 wxGetApp().ProcessIdle()
452
453
f3d9dc1d
RD
454 #---------------------------------------------
455 def OnIconfiy(self, evt):
456 wxLogMessage("OnIconfiy")
457 evt.Skip()
458
459 #---------------------------------------------
460 def OnMaximize(self, evt):
461 wxLogMessage("OnMaximize")
462 evt.Skip()
463
464
465
466
cf694132
RD
467#---------------------------------------------------------------------------
468#---------------------------------------------------------------------------
469
b5a5d647
RD
470class MySplashScreen(wxSplashScreen):
471 def __init__(self):
6c5ae2d2 472 bmp = wxImage(opj("bitmaps/splash.gif")).ConvertToBitmap()
b5a5d647
RD
473 wxSplashScreen.__init__(self, bmp,
474 wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_TIMEOUT,
475 4000, None, -1)
476 EVT_CLOSE(self, self.OnClose)
477
478 def OnClose(self, evt):
9fb56e0c 479 frame = wxPythonDemo(None, -1, "wxPython: (A Demonstration)")
cf694132 480 frame.Show(true)
f6bcfd97 481 self.ShowTip(frame)
a1bfae9d 482 self.Destroy()
f6bcfd97
BP
483
484 def ShowTip(self, frame):
485 try:
6c5ae2d2 486 showTipText = open(opj("data/showTips")).read()
f6bcfd97
BP
487 showTip, index = eval(showTipText)
488 except IOError:
489 showTip, index = (1, 0)
f6bcfd97 490 if showTip:
6c5ae2d2 491 tp = wxCreateFileTipProvider(opj("data/tips.txt"), index)
f6bcfd97
BP
492 showTip = wxShowTip(frame, tp)
493 index = tp.GetCurrentTip()
6c5ae2d2 494 open(opj("data/showTips"), "w").write(str( (showTip, index) ))
f6bcfd97 495
cf694132 496
b5a5d647
RD
497
498class MyApp(wxApp):
499 def OnInit(self):
500 """
68320e40 501 Create and show the splash screen. It will then create and show
b5a5d647
RD
502 the main frame when it is time to do so.
503 """
504 wxInitAllImageHandlers()
505 splash = MySplashScreen()
506 splash.Show()
507 wxYield()
508 return true
509
510
511
cf694132
RD
512#---------------------------------------------------------------------------
513
514def main():
e02c03a4 515 try:
d56cebe7 516 demoPath = os.path.dirname(__file__)
e02c03a4
RD
517 os.chdir(demoPath)
518 except:
519 pass
cf694132
RD
520 app = MyApp(0)
521 app.MainLoop()
522
523
524#---------------------------------------------------------------------------
525
526
527
f6bcfd97
BP
528overview = """<html><body>
529 <h2>Python</h2>
530
531 Python is an interpreted, interactive, object-oriented programming
532 language often compared to Tcl, Perl, Scheme, or Java.
533
534 <p> Python combines remarkable power with very clear syntax. It has
535 modules, classes, exceptions, very high level dynamic data types, and
536 dynamic typing. There are interfaces to many system calls and
537 libraries, and new built-in modules are easily written in C or
538 C++. Python is also usable as an extension language for applications
539 that need a programmable interface. <p>
540
541 <h2>wxWindows</h2>
542
543 wxWindows is a free C++ framework designed to make cross-platform
544 programming child's play. Well, almost. wxWindows 2 supports Windows
545 3.1/95/98/NT, Unix with GTK/Motif/Lesstif, with a Mac version
546 underway. Other ports are under consideration. <p>
547
548 wxWindows is a set of libraries that allows C++ applications to
549 compile and run on several different types of computers, with minimal
550 source code changes. There is one library per supported GUI (such as
551 Motif, or Windows). As well as providing a common API (Application
552 Programming Interface) for GUI functionality, it provides
553 functionality for accessing some commonly-used operating system
554 facilities, such as copying or deleting files. wxWindows is a
555 'framework' in the sense that it provides a lot of built-in
556 functionality, which the application can use or replace as required,
557 thus saving a great deal of coding effort. Basic data structures such
558 as strings, linked lists and hash tables are also supported.
559
560 <p>
561 <h2>wxPython</h2>
562
563 wxPython is a Python extension module that encapsulates the wxWindows
564 GUI classes. Currently it is only available for the Win32 and GTK
565 ports of wxWindows, but as soon as the other ports are brought up to
566 the same level as Win32 and GTK, it should be fairly trivial to
567 enable wxPython to be used with the new GUI.
568
569 <p>
570
571 The wxPython extension module attempts to mirror the class heiarchy
572 of wxWindows as closely as possible. This means that there is a
573 wxFrame class in wxPython that looks, smells, tastes and acts almost
574 the same as the wxFrame class in the C++ version. Unfortunately,
575 because of differences in the languages, wxPython doesn't match
576 wxWindows exactly, but the differences should be easy to absorb
577 because they are natural to Python. For example, some methods that
578 return multiple values via argument pointers in C++ will return a
579 tuple of values in Python.
580
581 <p>
582
583 There is still much to be done for wxPython, many classes still need
584 to be mirrored. Also, wxWindows is still somewhat of a moving target
585 so it is a bit of an effort just keeping wxPython up to date. On the
586 other hand, there are enough of the core classes completed that
587 useful applications can be written.
588
589 <p>
590
591 wxPython is close enough to the C++ version that the majority of
592 the wxPython documentation is actually just notes attached to the C++
593 documents that describe the places where wxPython is different. There
594 is also a series of sample programs included, and a series of
595 documentation pages that assist the programmer in getting started
596 with wxPython.
597
598 """
cf694132
RD
599
600
601#----------------------------------------------------------------------------
602#----------------------------------------------------------------------------
603
604if __name__ == '__main__':
605 main()
606
607#----------------------------------------------------------------------------
608
609
610
611
612
613
614