0
Hello!
I’m trying to learn Kivy...
1) I would like to select all text within a Text Input in Kivy. Which attribute should I study to change my code myself?;
2) After selecting all the text, the copy button should copy the text. Which attribute should I study to change my code myself?;
3) Subject for part: how to ensure that accented characters are recognised? I don’t even know how to ask to be told what I should research to fix this.
File example: main py.
from kivy.app import App
class MainApp(App):
def build(self):
self.title = 'Meu primeiro app'
if __name__ == '__main__':
MainApp().run()
File example: main.Kv
FloatLayout:
Label:
text: "Título do meu app"
font_size: '60sp'
top: 350
TextInput:
text: "Escreva aqui seu texto"
height: "350px"
width: 350
top: 500
size_hint: None, None
pos_hint: {'center_x': 0.5,}
Button:
text: "Botão 1"
height: 40
width: 120
top: 140
size_hint: None, None
pos_hint: {'center_x': 0.4,}
Button:
text: "Botão 2"
height: 40
width: 120
top: 140
size_hint: None, None
pos_hint: {'center_x': 0.6,}
Button:
text: "Selecionar"
height: 40
width: 120
top: 95
size_hint: None, None
pos_hint: {'center_x': 0.4,}
Button:
text: "Copiar"
height: 40
width: 120
top: 95
size_hint: None, None
pos_hint: {'center_x': 0.6,}
The question is clear and objective. About the code I agree that could be more complete, however, I preferred to present only this part, because it is better to present something clean than a mess that even I was not understanding. I don’t need you to touch the code. I just need an indication: which attribute to select the text I should study? You can make a statement?
– Wilson Junior
I have even tried using the example of this page ---> https://coredump.pt/questions/50433534/python-kivy-how-to-select-a-textinput-without-mouse-click <--- but it does not work. I’ve even tried to play it like it is, but the window is all black.
– Wilson Junior