0

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 before 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.

justrajdeep
  • 855
  • 3
  • 12
  • 29

1 Answers1

0

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.

Mike Driscoll
  • 32,629
  • 8
  • 45
  • 88
  • i want the information in multiple TextCtrl because each will have a spin ctrl which the user can modify. – justrajdeep Jan 27 '11 at 08:15
  • In that case, then use the parent's GetChildren() method and iterate over it to grab the data from the widgets. If you only want to grab data from Spinners, than use isinstance. – Mike Driscoll Jan 27 '11 at 18:40