I am creating a GUI using wxPython. The first window involves making a box with attributes such as title (Big Font Text, results from a file that i will be reading in, want an arrow that changes position depending on results. So think of it like a progress bar.
Then i repeat this 8 times just with different attributes. However, i am unable to create the first base class with the methods and parameters to do this. Example
when i create my front i want to then create a "zone" object with the parameters being fed in from a list.
This is what i have so far:
import wx class mainFrame(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title,style=wx.MINIMIZE_BOX|wx.SYSTEM_MENU|wx.CAPTION) mainBox = wx.BoxSizer(wx.VERTICAL) tiles = wx.GridSizer(3, 3, 60, 60) for i in range(0,9): panel = wx.Panel(self, -1, style=wx.DOUBLE_BORDER) tiles.Add(panel, flag=wx.EXPAND) mainBox.Add(tiles, 1, wx.EXPAND | wx.TOP| wx.ALL, 30) self.SetSizer(mainBox) self.SetBackgroundColour(wx.Colour(120,200,200,10)) self.Maximize() self.Show() app = wx.App(0) frame = mainFrame(None, -1, 'System Overview.py') app.MainLoop()
It got messy real quick on my first attempt as i had to manually place buttons, text, bitmaps, listbox etc. Trying to put them in functions and minimise code.