Default debug Shift + O keybinding && Scrolling behaving weirdly with TextInput

已查看 3 次
跳至第一个未读帖子

vincent...@paarly.com

未读,
2017年8月16日 09:30:022017/8/16
收件人 Kivy users support
Hi everyone,

I'm currently trying to make an simple character sheet app, and I've decided to use kivy. So far I'm really happy with whay kivy can do, and there are only a few things I still have problems with. I've been surfing the net for a while and I don't seem to find anything addressing these.

The first one is this keybinding. By default, if you press shift + O in your app, it toggles a display in the upper-left corner of your app, displaying the FPS, the temperature of your cpus, the vram used, etc.

Here is a minimum working example (taken directly from the kivy website):
import kivy
kivy.require('1.0.6') # replace with your current kivy version !

from kivy.app import App
from kivy.uix.label import Label


class MyApp(App):

def build(self):
return Label(text='Hello world')


if __name__ == '__main__':
MyApp().run()


The problem is this display is also toggled when you type 'O' in a TextInput using Shift + o, and it's accompanied by a visible lag.
How can I disable this keybinding?


My second question concerns ScrollView. I've got a multiline TextInput contained in a ScrollView, here the bit of kv defining those:
ScrollView:
id: scrollview_notes
TextInput:
id: notes
auto_indent: True
size_hint : 1, None
height: max(self.minimum_height, scrollview_notes.height)
background_color: [130.0/255.0, 130.0/255.0, 130.0/255.0, 1.0]
cursor_color: [1, 1, 1, 1]
foreground_color: [1, 1, 1, 1]
on_text: root.update_notes(value=self.text)

The on_text event keeps an internal variable up to date with the interface. Anyway, I can scroll fine this the mouse or the wheel. My problem is when my cursor gets to the "bottom" of the TextInput (due to me repeatedly pressing enter, for example), it goes out of view without the scrolling following it (contrary to the behavior of most text softwares). 

I've digged up a little and it seems the scroll_y value of the ScrollView widget isn't updated upon modification of the content of the TextInput, which makes sense in a way since they are separate widgets, but is there a clean way to link them?

Thanks in advance for any help,
Vincent Bragard.
回复全部
回复作者
转发
0 个新帖子