Forum Archive

UI: could not bind action, button name not defined.

wiley

Howdy! I’m a beginner fooling around with the ui module. I’ve created a pyui layout in the editor, and set my button actions to functions in my python script, but I’m getting an error that the button names aren’t defined? Isn’t that supposed to be happening in the pyui file?

Here’s a link to my project if anyone has time to make a suggestion.
https://github.com/weevil/adventurers_guild

The relevant files are guild-ios.py and guild-ios.pyui

omz

I think you'll need to place the nextButton function above the load_view call, but there might be other issues that I'm not seeing right now.

zrzka
  • Do what Ole wrote.
  • Do the same thing for the saveButton.
  • Both functions (saveButton, nextButton) should have one argument.
  • Either rename saveButton function to save or change save action to saveButton in your .pyui file.

Then it will work. Except other issues like accessing local variable seed before assignment, etc. But these errors are not Pythonista related.

wiley

Thanks, that did it!