Error w/ wxStyledTextCtrl

Are you creating you application with:

myApp = mywxApp(1)?

If so, change the 1 to a 0 (so stdout/err is not redirected to a textbox), and run your code from the command prompt (i.e. python myscript.py).

You should get the *real* reason for your crash (the full traceback) then at the top of the error message dump. Unless you are redirecting stdout/err someplce else. If so, just comment it out until you find the problem.

Mark.

Anders Schneiderman wrote:

···

In a search for a more elegant solution to the problem I had being unable to suppress scrollbars for text controls, I decided to check out wxStyledTextCtrl. What I'd like to do is put a wxStyledTextCtrl inside a split window, ala PyCrust. I got a very strange error when I tried running it: it would launch for a fraction of a second, then complain:

12:19:45: Debug: c:\projects\wx\src\msw\app.cpp(439): 'UnregisterClass(canvas)'
failed with error 0x00000584 (class still has open windows.).

Here's the code that created it:
--------------------
self.split = wxSplitterWindow(self, 50)
self.splitv = wxSplitterWindow(self.split, 60)
self.splitv.Show(true)

self.codeWindow = wxStyledTextCtrl(self.splitv, -1)
self.log = wxTextCtrl(self.splitv, -1, style = wxTE_MULTILINE|wxTE_READONLY)
self.input = wxTextCtrl(self.split, 10, style = wxTE_PROCESS_ENTER)
self.Show(true)

self.split.SplitHorizontally(self.input, self.splitv)
self.split.SetSashPosition(30, true)
self.splitv.SplitVertically(self.codeWindow, self.log)
self.splitv.SetSashPosition(500, true)
--------------------
Any idea why it's crashing?

Thanks,
Anders

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

Anders Schneiderman wrote:

...

self.split.SplitHorizontally(self.input, self.splitv)
self.split.SetSashPosition(30, true)
self.splitv.SplitVertically(self.codeWindow, self.log)
self.splitv.SetSashPosition(500, true)
--------------------
Any idea why it's crashing?

another suggestion (sorry, can't help with the crash) - check

for possibly a better way to do your splitter window management.

Shi.