I just wanted to add the time to a button on the menu bar(constantly updating using the title). The code below works, but the refreshing is very bad. I am guessing I am mis-using the menu buttons intended function here. Look, it's not important. I just thought, I am possibly missing something simple also about refreshing. Will understand if I get no replies.
@ui.in_background
def time_btn(self):
#self.menu_button(...) just adding a button to
#aView.right_button_items, returning the button.
btn = self.menu_button('Time', False,None)
#btn.enabled = False
while(True):
if not self.view.on_screen: break
btn.title = time.strftime('%H:%M:%S')
time.sleep(1)
As a side question, I also have Editorial, I wrote this text up in Editorial, and I could not see an easy way to copy and paste the markdown directly into here. I have only just began to use Editorial and markdown, but it makes sense for me to write posts like this in Editorial so I can see the formatted text and paste it in here directly.