Skip to content
Snippets Groups Projects
Commit 6bbca5f3 authored by Brady James Garvin's avatar Brady James Garvin
Browse files

Initial commit.

parents
No related branches found
No related tags found
No related merge requests found
.idea
*.pyc
*.pyo
*.apk
GridLayout:
rows: 2
main.py 0 → 100644
from kivy.app import App
from kivy.uix.button import Button
from kivy.properties import NumericProperty, StringProperty
class OneTimeButton(Button):
count = 0
index = NumericProperty(-1)
def __init__(self):
super(OneTimeButton, self).__init__()
self.index = OneTimeButton.count
OneTimeButton.count += 1
def on_press(self):
self.disabled = True
print(self.index)
class GuessingButton(Button):
hidden_text = StringProperty('')
def __init__(self, hidden_text):
super(GuessingButton, self).__init__()
self.hidden_text = hidden_text
def on_press(self):
if self.text == '':
self.text = self.hidden_text
else:
self.text = ''
class DemoApp(App):
def build(self):
for i in range(5):
self.root.add_widget(OneTimeButton())
for i in range(5):
self.root.add_widget(GuessingButton(str(i)))
if __name__ == "__main__":
app = DemoApp()
app.run()
class BaseClass(object):
def __str__(self):
return 'BaseClass'
class Specialization(BaseClass):
def __str__(self):
text = super(Specialization, self).__str__()
return 'Specialization of {text}'.format(text=text)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment