Reputation: 4043
I don't like the default gradient background for the unfocused TextInput
so I edited the default texture in Paint. But it doesn't seem to recognize it. It's in a separate file and looks like this:
The texture I get is just plain white. Do I need a specific file with the texture or to move the texture to the place where it is in the default texture? This is a test code:
from kivy.app import App
from kivy.uix.textinput import TextInput
from kivy.uix.boxlayout import BoxLayout
class App1(App):
def build(self):
b = BoxLayout()
tx1 = TextInput()
tx = TextInput(background_normal = "E:\textinput_unfocused.png")
b.add_widget(tx1)
b.add_widget(tx)
return b
App1().run()
Oh, by the way. The source code is located in the E: disk, as well as the textinput_unfocused.png
.
Upvotes: 1
Views: 746
Reputation: 323
the path for Your background should be specified relative to the app file. So if they are both in the same directory just put:
tx = TextInput(background_normal = "textinput_unfocused.png")
Upvotes: 1