Issues trying to access dynamic widget properties in ScreenManager

8 views
Skip to first unread message

Ed_S

unread,
Mar 27, 2015, 3:38:28 PM3/27/15
to kivy-...@googlegroups.com
My code snippet below contains a one test input template that gets called in every screen. Every screen test should have a button with a on_press event corresponding to the test itself --  which are all different.
Since the input field is the same, i would like to call it dynamically like i started here but i don’t know how to exactly change the on-press event on the test itself.
Any help or ideas would help on getting the dynamic on_press events to work. NB: I have 6 tests each calling a unique funtion, the testing layout is same.

<Tests@FloatLayout>
Button:
TextInput:
Button:
on_press: root.call_some_test_function()

<MyScreenManager@ScreenManager>:
id:sm

Screen:
name: 'Test1'

Tests:
on_press: #call function corresponding to test 1
size_hint_y: 0.5

Button:
text: 'Go Home'
on_release:root.current = 'Home'

Screen:
name: 'Test2'

Tests:
on_press: #call function corresponding to test 2
size_hint_y: 0.5

Reply all
Reply to author
Forward
0 new messages