P
P
Parsivali2022-02-15 06:51:20
Python
Parsivali, 2022-02-15 06:51:20

How to take text from textfield kivy md?

I made a textfield using kivymd but I don't know how to use what can be written there. For example, make a button that will use the text from the textfield
620b22632aa29392498605.png

from kivy.lang import Builder
from kivymd.app import MDApp
from kivy.uix.screenmanager import ScreenManager, Screen
from kivymd.uix.textfield import MDTextField
from kivy.core.window import Window
Window.clearcolor = (23/255, 23/255, 23/255, 1)
Window.title = "Number"

KV = '''
<Number>:
MDTextField:
  id: TakenNum
  size_hint_x: None
  width: "300dp"
  hint_text: "Enter number (+373, no space)"
  max_text_length: 12
  line_color_normal: 0, 0, 0, 0.5
  line_color_focus: 0, 0, 0, 1
  pos_hint: {"center_x": .5, "center_y": .8}
'''

class SmsBomb(MDApp):
    def build(self):
        return Builder.load_string(KV)


SmsBomb().run()

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question