import wx
class MyFrame([Link]):
def __init__(self, parent, title):
super().__init__(parent, title=title, size=(300, 200))
panel = [Link](self)
[Link] = [Link](panel, pos=(20, 20), size=(120, 80))
# Botões para interagir com a ListBox
add_button = [Link](panel, label="Adicionar Item", pos=(150, 20))
check_button = [Link](panel, label="Verificar", pos=(150, 60))
add_button.Bind(wx.EVT_BUTTON, self.on_add_item)
check_button.Bind(wx.EVT_BUTTON, self.on_check_items)
def on_add_item(self, event):
[Link]("Novo Item")
def on_check_items(self, event):
if [Link]() > 0:
[Link]("A lista contém itens.", "Verificação")
else:
[Link]("A lista está vazia.", "Verificação")
class MyApp([Link]):
def OnInit(self):
frame = MyFrame(None, "Exemplo wxListBox")
[Link]()
return True
app = MyApp()
[Link]()