Hello
The code bellow (and attached) intends to create a frame containing a
grid with 4 buttons (which events have'nt been implemented yet) and a "close"
button. I wonder what is missing to get this working, though I've been
reading the docs. I chose wxPython
as mi python program's GUI tool because its accessible for my screen reader, since I'm visualy impaired
and should build layouts by deducting how it will look like. Beyond, my
close button doesn't work, but according to what I got from docs, it
should be right. I'd thank very much for any help! Regards,
Sarah Barreto Marques
import wx
class mainWindow:
def __init__(self, *args, **kwargs):
wx.Frame.__init__(self, *args, **kwargs)
self.sizer=wx.GridSizer(rows=2, cols=2, hgap=10, vgap=10)
self.panel=wx.Panel(self)
self.btTeste1=wx.Button(self.panel, -1, "teste 1")
self.btTeste2=wx.Button(self.panel, -1, "teste 2")
self.btTeste3=wx.Button(self.panel, -1, "teste 3")
self.btTeste4=wx.Button(self.panel, -1, "teste 4")
self.btClose=wx.Button(self.panel, wx.ID_CLOSE, "close")
self.btClose.Bind(wx.EVT_BUTTON, self.OnClose)
buttons=[self.btTeste1, self.btTeste2, self.btTeste3, self.btTeste4]
for i in botoes:
self.sizer.Add(i, 0, wx.EXPAND)
self.Show(True)
def OnClose():
self.Close(True)
app=wx.App(False)
frame=mainWindow(None, title="cognitive tests")
app.MainLoop()
Sarah Barreto Marques
Núcleo de Pesquisa em Sistemas de Informação - NSI/IF Fluminense
Napnee - IF Fluminense
www.audiogames.com.br
@sarahbmarques
wx.py (909 Bytes)