I am trying to build a invoice with wx grid, I would like to add the values in quantity column and the values in price column and display it in the row total.
import wx
import wx.grid as gridlib
class MyForm(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, wx.ID_ANY, "Invoice")
datag = 0
# Add a panel so it looks the correct on all platforms
panel = wx.Panel(self, wx.ID_ANY)
grid = gridlib.Grid(panel)
grid.CreateGrid(25, 3)
note_sizer = wx.BoxSizer()
note_sizer.Add(grid, 1, wx.EXPAND)
panel.SetSizer(note_sizer)
# We can set the sizes of individual rows and columns
# in pixels
grid.SetColSize(0, 520)
# change a couple column labels
grid.SetColLabelValue(0, "Product")
grid.SetColLabelValue(1, "Quantity")
grid.SetColLabelValue(2, "Price")
grid.SetColFormatFloat(2)
grid.SetCellValue(24, 0, 'Total')
if __name__ == "__main__":
app = wx.App()
frame = MyForm().Show()
app.MainLoop()
can anyone help?