wxpython: Updating a dict or other appropriate data type from wx.lib.sheet.CSheet object

Posted by bvmou on Stack Overflow See other posts from Stack Overflow or by bvmou
Published on 2008-11-29T21:00:12Z Indexed on 2010/04/01 6:03 UTC
Read the original article Hit count: 277

Filed under:
|
|
|

If I have a notebook with three spreadsheet widgets, what is the best way to have changes to the spreadsheet update a dictionary (or maybe an sqlite file?). Do all wx grid objects come with a built in dictionary related to the SetNumberRows and SetNumberCols? Basically I am looking for guidance on how to work with the user-input data from a spreadsheet widget, as in this example adapted from the tutorial on python.org:

class ExSheet(wx.lib.sheet.CSheet):
    def __init__(self, parent):
        sheet.CSheet.__init__(self, parent)
        self.SetLabelBackgroundColour('#CCFF66')
        self.SetNumberRows(50)
        self.SetNumberCols(50)

class Notebook(wx.Frame):
    def __init__(self, parent, id, title):
        wx.Frame.__init__(self, parent, id, title)
        nb = wx.Notebook(self, -1, style=wx.NB_BOTTOM)
        self.sheet1 = ExSheet(nb)
        self.sheet2 = ExSheet(nb)
        self.sheet3 = ExSheet(nb)
        nb.AddPage(self.sheet1, "Sheet1")
        nb.AddPage(self.sheet2, "Sheet2")
        nb.AddPage(self.sheet3, "Sheet3")
        self.sheet1.SetFocus()
        self.StatusBar()

© Stack Overflow or respective owner

Related posts about wxpython

Related posts about wx