Code: Alles auswählen
#!/usr/bin/env python3
import wx
import wx.grid
def main():
app = wx.App()
frame = wx.Frame(None, wx.ID_ANY, "")
frame.SetSize(650,300)
frame.SetTitle("frame")
panel = wx.Panel(frame, wx.ID_ANY)
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(wx.Button(panel, -1, 'Fixed Button'), 0, wx.ALIGN_CENTER, 0)
sizer.Add(wx.Button(panel, -1, 'Expanded Button'), 0, wx.EXPAND, 0)
grid1 = wx.grid.Grid(panel, wx.ID_ANY, size = (200,100))
grid1.CreateGrid(10,5)
sizer.Add(grid1, 1, wx.EXPAND, 0)
sizer.SetSizeHints(panel)
panel.SetSizer(sizer)
frame.Layout()
frame.Show()
app.SetTopWindow(frame)
app.MainLoop()
if __name__ == "__main__":
main()