I'm using wxpython.
I'd like to solve a simple problem for a GUI that consists of a button "Add", which when pressed creates a new button called "Remove". You can press "Add" as many times as you like and many remove buttons are created and added to the panel.
What I would like is for when you press one of the remove buttons, that remove button itself is removed from the panel.
The problem is when you bind a function to a button with this:
self.Bind(wx.EVT_BUTTON, self.remove_function, button_name)
you can't pass an argument to the function telling it which button to remove. (Or can you?)
If your trouble is to pass an argument to the function, consider following:
self.Bind(wx.EVT_BUTTON, lambda e: otherFunction(arg1, arg2), button_name)
A simple example for adding and removing buttons in wxpython