Reputation: 1
I would like the text entered in the text field to be output to the console, please tell me
from kivymd.app import MDApp
from kivymd.uix.screen import MDScreen
from kivymd.uix.textfield import MDTextField, MDTextFieldHelperText, MDTextFieldHintText
from kivymd.uix.button import MDButtonText, MDButton
class MainApp(MDApp):
def build(self):
self.theme_cls.theme_style = "Light"
screen = MDScreen()
text_input = MDTextField(
MDTextFieldHelperText(
text="Проверьте свой пароль",
mode="persistent",
),
MDTextFieldHintText(
text="Введите пароль",
),
pos_hint={"center_x": 0.5, "center_y": 0.6},
size_hint=(0.5, 1)
)
screen.add_widget(text_input)
self.text_check_button = MDButton(
MDButtonText(
text = 'Проверить'
),
pos_hint={"center_x": 0.5, "center_y": 0.4},
on_release=self.show_data
)
screen.add_widget(self.text_check_button)
return screen
def show_data(self, obj):
print(self.text_check_button.text)
MainApp().run()
In general, I want to make it output not to the console but to the dialog box before checking according to the conditions, I would be grateful if you also helped with how to output the dialog box, but at least deal with the console
Upvotes: 0
Views: 16