문제

I am trying to implement a simple application. It use wx.FileDialog to select a file, then display the file name in a wx.TextCtrl component.

It works allright at first, the file name was displayed as expected. However, when the mouse move over the text control component, the contents are gone.

Here is my code:

fdlg_input_dir = wx.FileDialog(dlg_input, "Choose input file", os.getcwd(), "", "All files(*.*)|*.*", wx.OPEN)

fdlg_input_dir.ShowModal()

textctrl_input_dir = wx.TextCtrl(dlg_input, 5, fdlg_input_dir.GetPath(), size=(300,20), pos=(85,20))

So my questions is, how to remain the contents in the TextCtrl component while the mouse moves over it?

Any suggestions are appreciated. Thanks.

도움이 되었습니까?

해결책

Problem solved. It turns out that the initial text in the control component doesn't stand. Instead, using following code should archieve what I expected:

textctrl_input_dir.write(fdlg_input_dir.GetPath())
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top