开发者

wxPython: TextCtrl problem

开发者 https://www.devze.com 2023-02-07 06:10 出处:网络
I am trying to build my first wx application I have a browse button in my panel, the user adds his file. i do some processing on the file.

I am trying to build my first wx application I have a browse button in my panel, the user adds his file. i do some processing on the file. Now i want to show the information in a TextCtrl so that the user may modify it. Then i need to write it in a file. But I dont know how many TextCtrl box is needed befo开发者_Go百科re processing the file. Using the browse button event i have got the file, extracted the information also. But i dont know how to show the information back to the user.

any suggestion is appreciated.


If all you're doing is showing one file, then all you need is one TextCtrl. I would give the widget the wx.TE_MULTILINE style and add it to a sizer with an EXPAND flag:

sizer.Add(myTxtCtrl, 0, wx.EXPAND)

Then the user can see the file and you can save the data with a Save button or menu item. The handler for that would basically just grab the text control's contents using it's GetValue() method.

0

精彩评论

暂无评论...
验证码 换一张
取 消