Note that there are some explanatory texts on larger screens.

plurals
  1. POKivy input values for simple calculations
    text
    copied!<p>I'm quite new to Kivy (started yesterday) and am trying to create a simple enough app that has input boxes for several values of height and area to calculate volumes. I cant find any working methods of doing this. So far all I have got is this:</p> <pre><code>from kivy.app import App from kivy.lang import Builder from kivy.uix.screenmanager import ScreenManager, Screen Builder.load_string(""" &lt;MenuScreen&gt;: FloatLayout: Label: text: 'Please Select an Area to Work With:' pos: 230, 490 size_hint: .15, .05 font_size: 23 Button: text: "A" pos: 230, 100 size_hint: .4,.1 font_size: 23 on_press: root.manager.current = 'settings' Button: text: "B" pos: 230, 210 size_hint: .4,.1 font_size: 23 on_press: root.manager.current = 'settings' Button: text: "C" pos: 230, 320 size_hint: .4,.1 font_size: 23 on_press: root.manager.current = 'settings' Button: text: "D" pos: 230, 420 size_hint: .4,.1 font_size: 23 on_press: root.manager.current = 'settings' &lt;SettingsScreen&gt;: GridLayout: Label: text: 'Room 1' pos: 6, 460 size_hint: .15, .05 font_size: 23 Label: text: 'Room 2' pos: 6, 420 size_hint: .15, .05 font_size: 23 Label: text: 'Room 3' pos: 6, 380 size_hint: .15, .05 font_size: 23 Label: text: 'Room 4' pos: 6, 340 size_hint: .15, .05 font_size: 23 Label: text: 'Room 5' pos: 6, 300 size_hint: .15, .05 font_size: 23 Label: text: 'Room 6' pos: 6, 260 size_hint: .15, .05 font_size: 23 TextInput: text1: "0" multiline: False pos: 200,420 font_size: 23 on_text: viewer.text = self.text1 size_hint: .001, .001 TextInput: text2: "0" multiline: False pos: 200, 420 font_size: 23 on_text: viewer.text = self.text2 size_hint: .001, .001 TextInput: text3: "0" multiline: False pos: 200,380 font_size: 23 on_text: viewer.text = self.text3 size_hint: .001, .001 TextInput: text4: "0" multiline: False pos: 200,340 font_size: 23 on_text: viewer.text = self.text4 size_hint: .001, .001 TextInput: text5: "0" multiline: False pos: 200,300 font_size: 23 on_text: viewer.text = self.text5 size_hint: .001, .001 TextInput: text6: "0" multiline: False pos: 200,240 font_size: 23 on_text: viewer.text = self.text6 size_hint: .001, .001 """) # Declare both screen class MenuScreen(Screen): pass class SettingsScreen(Screen): pass # Create the screen manager sm = ScreenManager() sm.add_widget(MenuScreen(name='menu')) sm.add_widget(SettingsScreen(name='settings')) class TestApp(App): def build(self): return sm if __name__ == '__main__': TestApp().run() </code></pre> <p>Im planning to have the second page unique for each button pressed, but want Any help would be appreciated.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload