I suspect you have a different problem, readonly should not impact scrolling.
I see a few things that are errors in your kv code:
The attributes do_scroll_x, do_scroll_y are attributes of ScrollView, not TextInput.
The readonly attribute in TextInput is not properly indented. I don’t know what layout January1Windows is derived from, I will assume it is a screen. You have a potential problem that you are setting the size, but not setting the size_hint: None, None. The size will be ignored if the hint is not turned off.
I created a small example that scrolls the textInput and switches the readonly attribute.
Here is an example:
from kivy.app import App
from kivy.lang import Builder
kv = """
BoxLayout:
orientation: 'vertical'
Label:
text: 'Scroll TextInput'
size_hint_y: None
height: 48
ToggleButton:
size_hint_y: None
height: 48
text: 'Set Read-Only'
on_state: text_input.readonly = True if self.state else False
ScrollView:
bar_color:(0, 0, 0, 0.4)
bar_inactiv_color:(0, 0, 0.7, 0.4)
bar_margin:2
bar_width:8
do_scroll_x:True
do_scroll_y:True
TextInput:
id: text_input
size_hint: .8, None
height: self.minimum_height
text: 'This is a long long long set of words\\n' * 100
"""
class ScrollTextApp(App):
def build(self):
return Builder.load_string(kv)
ScrollTextApp().run()
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/7c75e712-0853-4d16-8ecb-a7550f547491n%40googlegroups.com.
When you not in readonly mode, the text is scrolling with in the TextInput, you are not scrolling the ScrollView.
I suggest you capture the keyboard arrows and use the key press to modify the scroll value (see scroll_x and scroll_y). This will give you a consistent experience when scrolling with keys or the mouse wheel.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/4137bb1a-616a-48e2-9c97-187160081e21n%40googlegroups.com.
I have not done any mobile development. If you share a minimal executable example I’ll be happy to take a look.
I’m not exactly sure what you are trying to achieve. On mobile I would think it would be more natural to scroll with a finger, than typing arrows.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/d623b814-b8ea-4b17-9fb0-3bb56ec8bf50n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/61e797f3.1c69fb81.eb87.4bfcSMTPIN_ADDED_MISSING%40gmr-mx.google.com.