I am trying to create a web crawler based on specific user input. For example, the User Input I am trying to receive is from a ListBox and a text field. Once I have that information, I would like the user to click a button to start the search with the information collected.
This is where I have been getting problems. The EVT function doesn't recognize the listbox since its been linked to the Button evt. Is there a way to solve the problem? Can EVT information be shared with other EVTs?
Here is what I have so far:
import wx # for gui class MyFrame(wx.Frame): def __init__(self, parent, id): wx.Frame.__init__(self, parent, id, 'Title', size=(300,200)) tournLevel = ['$10,000', '$15,000', '$20,000', '$50,000','$75,000','$100,000'] levelBox = wx.ListBox(panel, -1, (40, 50), (90, 90), tournLevel) levelBox.SetSelection(1) # default selection checkButton = wx.Button(panel, label= "Check Now", pos = (150, 50), size = (90, 40)) self.Bind(wx.EVT_BUTTON, self.OnClick, checkButton) def OnClick(self, event): currLevel = event.GetSelection() print(currLevel) # to test if GetSelection is working if __name__ == '__main__': app = wx.App() frame = MyFrame(parent=None, id=-1) frame.Show() app.MainLoop()
I would be very happy if I could just get the button to recognize the ListBox results. Thank you for your time!