Hello there. So I'm playing aroung with python and pysfml, started writing pong clone. I began with creating UI, and I got little problem with callbacks and buttons. As you will see in the code (link below) in gamestatesettings.py I create a list of buttons, and in each of them I assign a callback method to invoke when pressed. And in this very method, I also invoke code on the same button explicitly e.g.
def diff_up(self, engine): engine.game_settings.difficulty_up() self.butt_list.set_text('# ' + engine.game_settings.get_difficulty())
which i find inconvenient.
And I don't have any idea how could I do this look nice. So maybe someone here will be so kind and suggest some solution for me?