Hello,
I’m struggling with a very simple thing. I’ve read the documentation and searched in Google but couldn’t find a solution.
I’ve got a text in a Button with some mark up portions. It works fine for the first mark up instruction, but not for the rest of the mark up instruction.
Below is a simple code that it’s not working on my machine (Windows 10 – Python 3.7 with latest Kivy version). If someone can help, it would be great!
Thank you,
Maxi
#---------------------------------------
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
kv = """
<Label>:
markup: True
color: 0,0,0,1
<MyWidget>:
orientation: 'vertical'
Button:
text: 'This work [color=FF0000]but not this[/color]'
Button:
text: '[color=FF0000]This work[/color] but not this'
Button:
text: '[b]working[/b]not working'
"""
Builder.load_string(kv)
class MyWidget(BoxLayout):
pass
class MyButtonsApp(App):
def build(self):
return MyWidget()
if __name__ == '__main__':
MyButtonsApp().run()
It works for me. I would recommend adding a ‘-‘ as below:
<Label>:
-markup: True
-color: 0,0,0,1
See: https://kivy.org/doc/stable/api-kivy.lang.html?highlight=lang#redefining-a-widget-s-property-style
--
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/68763f63-ba53-4a64-bfdb-76718a733bc6%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-...@googlegroups.com.