Reputation: 1
I have a grid in one file and I have text controls in another file. When the user clicks on OK, values of all text controls have to be shown in the grid.
mainDialog.self.mainGrid.InsertRows(len(allData), 1)
gridsize = mainDialog.self.mainGrid.GetGridCursorRow()
mainDialog.self.mainGrid.SetCellValue(len(allData), 0, str(eventName))
mainDialog.self.mainGrid.SetCellValue(len(allData), 1, str(eventDate))
mainDialog.self.mainGrid.SetCellValue(len(allData), 2, str(eventTimeReal))
mainDialog.self.mainGrid.SetCellValue(len(allData), 3, str(eventVenue))
Here, mainDialog is one file to which values have to be passed.
It shows the following error:
theGrid = mainDialog.mainDialog.mainGrid()
AttributeError: type object 'mainDialog' has no attribute 'mainGrid'
Upvotes: 0
Views: 654
Reputation: 33071
I don't think you're calling it right. You probably want "self.mainGrid.SetCellValue" or "mainDialog.mainGrid.SetCellValue". Personally, I think this the best way to communicate between multiple frames is to use the Publish / Subscribe model provided by pubsub. I wrote a tutorial on that very subject here: http://www.blog.pythonlibrary.org/2010/06/27/wxpython-and-pubsub-a-simple-tutorial/
Upvotes: 1