What I’m trying to do:
Adding a counter whenever a button is clicked.
What I’ve tried and what’s not working:
Not tried
Code Sample:
# this is a formatted code snippet.
# paste your code between ```
Clone link:
share a copy of your app
What I’m trying to do:
Adding a counter whenever a button is clicked.
What I’ve tried and what’s not working:
Not tried
Code Sample:
# this is a formatted code snippet.
# paste your code between ```
Clone link:
share a copy of your app
Do you want to add TO a counter or add A NEW counter every time you click a button?
This seems very simple and basic python.
On the button you want to handle the click, go to it’s properties. At the bottom there are the event handlers. Look for the click handler and click on the button:
This will create a new method that will be called every time the user clicks the button.
In this method you can increment the counter simply by using:
# self._counter could be anything you want, but you must define it first, propably in the init method.
self._counter += 1