Kivy, twisted and a label?

35 views
Skip to first unread message

Jeffrey Padfield

unread,
Aug 16, 2017, 6:02:38 PM8/16/17
to Kivy users support
I'm working on a custom chat bot for my twitch account. This is mostly to learn something knew with Python. I'm using Python 2.7 along with Kivy. Thanks to the post found here I was able to get the Twitch IRC client to connect along with Kivy having shown the .kv file I have. The think I can't figure out is how to update a label on my first tab page witht he id of twitch_chat. I have tried the following.

in privmsg in bot.py
self.factory.app.ids.twitch_chat.text = message
self.factory.app.id.twitch_chat.text = message 

This comes back with there is no ids or id in CrzyBot 

in print_message in main.py
self.id.twitch_chat.text = msg
self.ids.twitch_chat.text = msg 

This also comes back with there is no id or ids in CrzyBot.

All source can be found on github here. App will not connect without a twitch account with an oAuth token from TwitchApps which you will need to put in the correct spots in the config.py. A point in the right direction would help me out so much..

Bill Janssen

unread,
Aug 18, 2017, 8:27:09 PM8/18/17
to Kivy users support
I think your .kv file needs a tweak.  Try instead of <MainScreen> on the second line, <MainScreen@TabbedPanel>, which will define a widget type, and then at the bottom of your .kv file, add the line

MainScreen:

which will define an instance of the MainScreen widget as the root.

Bill

JR Padfield

unread,
Aug 18, 2017, 8:31:11 PM8/18/17
to Kivy users support
Thanks Bill. I figured it out late last night. I can use,

self.root.ids.twitch_chat.text

Thanks for the idea. I'll try to set up the .kv file as you mentioned to see if it works better.
Reply all
Reply to author
Forward
0 new messages