Still running… in multiple files, with global font_size…
This commit is contained in:
21
main.py
21
main.py
@@ -1,23 +1,14 @@
|
||||
from random import randint
|
||||
|
||||
from kivy.app import App
|
||||
from kivy.uix.boxlayout import BoxLayout
|
||||
|
||||
|
||||
class RanNum(BoxLayout):
|
||||
pass
|
||||
from kivy.properties import NumericProperty
|
||||
from rannum import RanNum
|
||||
|
||||
|
||||
class RanKivApp(App):
|
||||
def build(self):
|
||||
return RanNum()
|
||||
font_size = NumericProperty(24)
|
||||
|
||||
def generate_random_number(self):
|
||||
try:
|
||||
upper_boundary = int(self.root.ids.upper_boundary_input.text)
|
||||
self.root.ids.output.text = str(randint(1, upper_boundary))
|
||||
except ValueError:
|
||||
self.root.ids.output.text = 'Bitte nur positive,\nganze Zahlen eingeben!'
|
||||
def build(self):
|
||||
self.ran_num = RanNum()
|
||||
return self.ran_num
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user