On Oct 18, 2019, at 9:23 AM, Gumby <e.scott....@gmail.com> wrote:
I changed the callback to remove the blocking serial port call. The button now updates the text promptly, but the label is still doing the weird overwrite thing.
<kivyscrn.png>def callback(self, instance):if self.button.text == 'Start Scanning':self.button.text = 'Stop Scanning'#self.com.blinkLED()#self.pH1_text = self.com.read_pH()self.pH1_text = '7.777'self.label_pH1.text = self.pH1_textelse:self.button.text = 'Start Scanning'self.pH1_text = '8.888'self.label_pH1.text = self.pH1_text
--
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/54d7cb15-1c3c-4356-a4c5-279760653eba%40googlegroups.com.
<kivyscrn.png>
On Oct 18, 2019, at 9:39 AM, Elliot Garbus <elli...@cox.net> wrote:
This seems like a graphics driver problem. Can you update the OpenGL driver?
Another thing to try, declare the variables you are using to update the labels as kivy StringProperties.pH2_text = StringProperty(‘-.—-‘)Another hack to try, clear the string prior to updating it.
This seems like a graphics driver problem. Can you update the OpenGL driver?Sent from my iPhone
On Oct 18, 2019, at 9:23 AM, Gumby <e.scott...@gmail.com> wrote:
I changed the callback to remove the blocking serial port call. The button now updates the text promptly, but the label is still doing the weird overwrite thing.--<kivyscrn.png>def callback(self, instance):if self.button.text == 'Start Scanning':self.button.text = 'Stop Scanning'#self.com.blinkLED()#self.pH1_text = self.com.read_pH()self.pH1_text = '7.777'self.label_pH1.text = self.pH1_textelse:self.button.text = 'Start Scanning'self.pH1_text = '8.888'self.label_pH1.text = self.pH1_text
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-...@googlegroups.com.
class MyButton(Button):
button_text = StringProperty('Hit Me')
MyButton:
text: self.button_text
In the python code, I changed the text in the label directly by going through the ids dictionary. Read about it here: https://kivy.org/doc/stable/api-kivy.lang.html?highlight=ids#
def callback(self):
app = App.get_running_app()
if self.button_text == 'Hit Me':
self.button_text = 'Ouch that hurt!'
app.root.ids.label_1.text = 'Goodbye cruel world'
Of course I could have used another StringPropert to change the label as well, but wanted to show this additional capability.
I created a second Label (label_2), and changed it's text value directly in KV:
on_press:
self.callback()
label_2.text = 'What?' if self.text == 'Hit Me' else 'How?'
It is very easy to access the attributes of widgets in kv, using the id.Here is the updated code, this is the same as what I have attached:import kivy
from kivy.app import App
from kivy.uix.button import Button
from kivy.properties import StringProperty
from kivy.lang import Builder
kivy.require('1.11.1') # replace with your current kivy version !
kv = """
GridLayout:
cols: 2
MyButton:
text: self.button_text
on_press:
self.callback()
label_2.text = 'What?' if self.text == 'Hit Me' else 'How?'
BoxLayout:
orientation: 'vertical'
Label:
id: label_1
text: 'Hello world'
Label:
id: label_2
text: 'another way'
"""
class MyButton(Button):
button_text = StringProperty('Hit Me')
def callback(self):
app = App.get_running_app()
if self.button_text == 'Hit Me':
self.button_text = 'Ouch that hurt!'
app.root.ids.label_1.text = 'Goodbye cruel world'
else:
self.button_text = 'Hit Me'
app.root.ids.label_1.text = 'Hello World'
class MyApp(App):
def build(self):
return Builder.load_string(kv)
Make sure you update your graphics driver. I think that is all it could be.
From: Gumby
Sent: Monday, October 21, 2019 1:07 PM
To: Kivy users support
Subject: Re: [kivy-users] Re: Label Text Update Does Not Clear Previous Text
Thanks for being so helpful. But, it is still doing the same thing. BTW, my environment is Anaconda on Windows 10.
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/77f482f3-5763-454a-b925-cb19b28cd10b%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/77f482f3-5763-454a-b925-cb19b28cd10b%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/77f482f3-5763-454a-b925-cb19b28cd10b%40googlegroups.com.
That is a strange issue.
Perhaps there is a dependency that is the wrong version. Check that you have the correct versions of all of the kivy-deps.* files.
Here is my pip list:
Package Version
------------------- ----------
certifi 2019.3.9
chardet 3.0.4
docutils 0.14
idna 2.8
Kivy 1.11.0
kivy-deps.glew 0.1.12
kivy-deps.gstreamer 0.1.17
kivy-deps.sdl2 0.1.22
Kivy-Garden 0.1.4
mido 1.2.9
Pillow 6.0.0
pip 19.2.1
pipenv 2018.11.26
Pygments 2.4.2
pypiwin32 223
python-rtmidi 1.3.0
pywin32 224
requests 2.22.0
setuptools 41.0.1
urllib3 1.25.3
virtualenv 16.6.0
virtualenv-clone 0.5.3
wheel 0.33.4
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/b90ce2f0-01c7-4c42-8ab4-3f6fe392432c%40googlegroups.com.
The issue seems really weird, definitely not something I've seen before, but I really advice you not to give up, you'll will really find development in Kivy really exciting and fun as I have.
The issue it self might just be a small thing we are missing.
Since you're using an anaconda env (which is likely not the problem) but for the benefit of doubt you should reinstallation kivy again (normally), most time this could be the fix to most of this issues
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/b90ce2f0-01c7-4c42-8ab4-3f6fe392432c%40googlegroups.com.
--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/5dae2d77.1c69fb81.be774.e580SMTPIN_ADDED_MISSING%40gmr-mx.google.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/b90ce2f0-01c7-4c42-8ab4-3f6fe392432c%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/b90ce2f0-01c7-4c42-8ab4-3f6fe392432c%40googlegroups.com.
--
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-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/5dae2d77.1c69fb81.be774.e580SMTPIN_ADDED_MISSING%40gmr-mx.google.com.
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/13737e95-311a-4464-9806-1ed79981f8ca%40googlegroups.com.
On the command line type:pip list
Sent from my iPhone
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/13737e95-311a-4464-9806-1ed79981f8ca%40googlegroups.com.
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/008a960f-c6dc-47d0-86de-bae032757d5b%40googlegroups.com.
from kivy.app import Appfrom kivy.lang import Builderclass TestApp(App):def build(self):return Builder.load_string('''<ClearLabel@Label>canvas.before:Color:rgba: 0, 0, 0, 1 #blackRectangle:size: self.sizepos: self.posBoxLayoutcols: 2rows: 2on_parent:from kivy.clock import ClockClock.schedule_interval( lambda dt: but.trigger_action(), 1)Button:id: buttext: "Push Me..."on_release:normtext = normal_label.textnormal_label.text = self.textself.text = clear_label.textclear_label.text = normtextLabel:id: normal_labeltext: "Till"ClearLabel:id: clear_labeltext: "99999999999"''')if __name__ == "__main__":TestApp().run()
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/CAGfUSD%2B3Hyw9A6HmsZk701vxGApNV3Enr14JmwfDXE9p6CHGjA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/008a960f-c6dc-47d0-86de-bae032757d5b%40googlegroups.com.
--
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-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/CAGfUSD%2B3Hyw9A6HmsZk701vxGApNV3Enr14JmwfDXE9p6CHGjA%40mail.gmail.com.
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/2b376fb7-db24-4191-b579-a3eec52c7bd4%40googlegroups.com.
Glad to hear you got it working! Thanks for the follow up.
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/2b376fb7-db24-4191-b579-a3eec52c7bd4%40googlegroups.com.