Pythonista-Issues icon indicating copy to clipboard operation
Pythonista-Issues copied to clipboard

Change label.text but no Update

Open kami83 opened this issue 5 months ago • 15 comments

Hi,

i am changing the "label1.text" with this function, but on my view it is not updated? Can you tell me how to activate an update of the view?

Thanks a lot.

BR kami

` def swswitch (sender): if main['connectsw'].value == True:

        main['label1'].text = " Waiting..."
        #main.update()
        cb.scan_for_peripherals()
        count = time.time()
        
        while not mngr.peripheral and count >= time.time()-10: 
            
            pass
            
        if mngr.peripheral == None:
            main['label1'].text = " Device not found..."
            main['connectsw'].value = False
            cb.stop_scan()

    else:
        #v['viewbottom']['label1'].text = " Disconnected..."
        if mngr.peripheral != None:
            cb.cancel_peripheral_connection(mngr.peripheral)
    pass  

`

kami83 avatar Jul 31 '25 07:07 kami83