Use the canvas to draw a rectangle around the TextInput. Change the color to red if the there is an issue with the content.
--
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/f827bcfe-c11f-422e-a376-006ddb992979n%40googlegroups.com.
Here is an example:
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.textinput import TextInput
from kivy.properties import ColorProperty, ListProperty
kv = """
<OutlineTextInput>:
canvas.after:
Color:
rgba: root.color
Line:
width: 2
rectangle: (*self.pos, *self.size)
BoxLayout:
orientation: 'vertical'
Label:
text: 'Change Textbox Outline Color'
OutlineTextInput:
id: oti
size_hint_y: None
height: 30
BoxLayout:
size_hint_y: None
heignt: 48
Button:
text: 'outline color black'
on_release: oti.color = 'black'
Button:
text: 'outline color red'
on_release: oti.color = 'red'
"""
class OutlineTextInput(TextInput):
color = ColorProperty('black')
class ColorTIBorder(App):
def build(self):
return Builder.load_string(kv)
ColorTIBorder().run()
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/60342368.1c69fb81.a7ec9.5a15SMTPIN_ADDED_MISSING%40gmr-mx.google.com.