This is perhaps the weirdest problem I've encountered using wxpython. I
hope I'm just missing something.
Like the wxPython demo, I have an application that consists of a
splitter window with a tree control on the left side and a notebook on
the right. This application is a custom python code browser/editor. They
only type of windows I load into the notebook are wxStyledTextCtrl, or
more specifically PythonSTC from the demo. Things worked fine for
awhile, but I eventually I loss control of arrow keys in
wxStyledTextCtrl. After spending some time tracking down when I lose
control of arrow keys, I found that provoking a wxFileDialog was the
cause. Strange I know, but that's is the precise moment I loss control.
I have some code snippets below. Any suggestions?
def build_ctrls(self):
self.splitter = wxSplitterWindow(self, -1)
self.note = wxNotebook(self.splitter, -1)
self.tree = work_tree(self.splitter, IDC_TREE,self)
self.splitter.SetMinimumPaneSize(100)
self.splitter.SplitVertically(self.tree, self.note)
self.splitter.SetSashPosition(200)
self.new_editor("texcept.py")
self.new_editor("texcept.py")
self.new_editor("texcept.py")
def load_work_flow(self,evt):
## d =wxFileDialog(self,"Select a file",".","","*.py",wxOPEN)
## if d.ShowModal() == wxID_OK:
## strTdef = d.GetFilename()
## pos = string.rfind(strTdef,'.')
## strTdef = strTdef[:pos]
## exec 'from ' + strTdef + ' import *'
## inst = getSession()
## self.tree.load_tree(inst)
## d.Destroy()
## os.chdir(self.root_dir)
from OraPO_Out import *
inst = getSession()
self.tree.load_tree(inst)
def new_editor(self,filename):
ed = PythonSTC(self.note, -1)
ed.SetText(open(filename).read())
ed.EmptyUndoBuffer()
ed.SetMarginType(1, wxSTC_MARGIN_NUMBER)
ed.SetMarginWidth(1, 25)
self.note.AddPage(ed,filename)
···
_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users