X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/64be6958940c1aea9c69c386b6bac9eb463f60a9..107e4716f21f554f9b2f9bfe90b8ab96c12a4cd6:/utils/wxPython/demo/Main.py?ds=sidebyside diff --git a/utils/wxPython/demo/Main.py b/utils/wxPython/demo/Main.py index 949d747105..0d820d7ade 100644 --- a/utils/wxPython/demo/Main.py +++ b/utils/wxPython/demo/Main.py @@ -43,7 +43,7 @@ _treeList = [ ('wxPython Library', ['Sizers', 'Layoutf', 'wxScrolledMessageDialog', 'wxMultipleChoiceDialog', 'wxPlotCanvas']), - ('Cool Contribs', ['pyTree', 'hangman', 'SlashDot']), + ('Cool Contribs', ['pyTree', 'hangman', 'SlashDot', 'XMLtreeview']), ] @@ -109,21 +109,20 @@ class wxPythonDemo(wxFrame): self.nb = wxNotebook(splitter2, -1) # Set up a TextCtrl on the Overview Notebook page - self.ovr = wxTextCtrl(self.nb, -1, '', wxDefaultPosition, wxDefaultSize, - wxTE_MULTILINE|wxTE_READONLY) + self.ovr = wxTextCtrl(self.nb, -1, style = wxTE_MULTILINE|wxTE_READONLY) self.nb.AddPage(self.ovr, "Overview") # Set up a TextCtrl on the Demo Code Notebook page - self.txt = wxTextCtrl(self.nb, -1, '', wxDefaultPosition, wxDefaultSize, - wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL) + self.txt = wxTextCtrl(self.nb, -1, + style = wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL) self.txt.SetFont(wxFont(9, wxMODERN, wxNORMAL, wxNORMAL, false)) self.nb.AddPage(self.txt, "Demo Code") # Set up a log on the View Log Notebook page - self.log = wxTextCtrl(splitter2, -1, '', wxDefaultPosition, wxDefaultSize, - wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL) + self.log = wxTextCtrl(splitter2, -1, + style = wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL) (w, self.charHeight) = self.log.GetTextExtent('X') #self.WriteText('wxPython Demo Log:\n') @@ -153,7 +152,8 @@ class wxPythonDemo(wxFrame): w, h = self.log.GetClientSizeTuple() numLines = h/self.charHeight x, y = self.log.PositionToXY(self.log.GetLastPosition()) - self.log.ShowPosition(self.log.XYToPosition(x, y-numLines+1)) + self.log.ShowPosition(self.log.XYToPosition(x, y-numLines)) + ##self.log.ShowPosition(self.log.GetLastPosition()) self.log.SetInsertionPointEnd() def write(self, txt): @@ -218,7 +218,7 @@ class wxPythonDemo(wxFrame): # self.txt.WriteText("Cannot open %s file." % filename) try: self.txt.SetValue(open(filename).read()) - except IOException: + except IOError: self.txt.WriteText("Cannot open %s file." % filename)