Jan-28-2017, 01:59 PM
Thanks a lot, Yoritz!
With this, it works :-) .
( I wish the wypython docs would give hints to those kind of things, but I can search and search and search and never come across things like that... *sigh*)
And, well, as I have spend (wasted) time in it, the code... if ever somebody would be interested how to get such an error in an easy way.
With this, it works :-) .
( I wish the wypython docs would give hints to those kind of things, but I can search and search and search and never come across things like that... *sigh*)
And, well, as I have spend (wasted) time in it, the code... if ever somebody would be interested how to get such an error in an easy way.
import wx, wx.grid class Teilgridpanel(wx.Panel): def __init__(self, parent, id): wx.Panel.__init__(self, parent, id, pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.TAB_TRAVERSAL|wx.NO_BORDER) self.gridsize = gridsize = (1, 5) self.grid = wx.grid.Grid(self, style=wx.BORDER_SUNKEN) self.grid.CreateGrid(gridsize[0], gridsize[1]) for dyn in range(6): dystri = "x" try: self.grid.SetCellValue(0, dyn, dystri) except PyAssertionError: print "wrong row or column" class Mainframe(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title) # und das Datenpanel in seinem BoxSizer self.datenpanel = Teilgridpanel(self, wx.ID_ANY) self.dpbox = dpbox = wx.BoxSizer(wx.HORIZONTAL) dpbox.Add(self.datenpanel, 1, wx.EXPAND) hbox = wx.BoxSizer(wx.HORIZONTAL) hbox.Add(dpbox, 1, wx.EXPAND) self.SetSizerAndFit(hbox) if __name__ == "__main__": app = wx.App(0) mainframe = Mainframe(None, -1, "Mainframe") app.MainLoop()