I have in mind to loop through each cell in gridbagsizer column
(which holds text controls) and 'suck' their GetValue() values into a
csv.
I wrote this test to see how/if FindItemAtPosition() would let me
access the TextCtrls ultimately using a loop.
I can't even fathom how to get at one TextCtrl by position hence this
thread.
BTW once I do manage to get an itm that is a TextCtrl
How do I test that it is of the correct type?
BTW2 I can't see any way of making the program an attachment
cos I'm writing this in a box titled Message:
at url http://groups.google.com/group/wxpython-users/post
ie not via email. Can I send to this list via email?
import wx
txt = "1 2 3 4".split()
class Some_frame(wx.Frame):http://groups.google.com/grouphttp://
groups.google.com/group/wxpython-users/post/wxpython-users/post
def __init__(self):
wx.Frame.__init__(self, None, -1, "GridBagSizer Test")
self.sizer = wx.GridBagSizer(hgap=5, vgap=5)
for i in range(len(txt)):
self.sizer.Add( wx.TextCtrl( self, -1, txt[i] ), pos=( i,
1 ) )
self.SetSizerAndFit(self.sizer)
itm = self.sizer.FindItemAtPosition( (0,0) )
if itm == None:
wx.MessageBox("item == None")
#I don't understand why itm is None...
#and not a TextCtrl ?
else:
wx.MessageBox("item NOT None")
#I'm not sure how you test that itm is a TextCtrl ?
app = wx.App()
Some_frame().Show()
app.MainLoop()