@@ -101,7 +101,7 @@ def scan_networks_thread(self):
101101 if self .keep_running :
102102 # Schedule UI updates because different thread
103103 lv .async_call (lambda l : self .scan_button_label .set_text (self .scan_button_scan_text ), None )
104- lv .async_call (lambda l : self .scan_button .add_flag (lv .obj . FLAG . CLICKABLE ), None )
104+ lv .async_call (lambda l : self .scan_button .remove_state (lv .STATE . DISABLED ), None )
105105 lv .async_call (lambda l : self .refresh_list (), None )
106106
107107 def start_scan_networks (self ):
@@ -112,7 +112,7 @@ def start_scan_networks(self):
112112 return
113113 else :
114114 self .busy_scanning = True
115- self .scan_button .remove_flag (lv .obj . FLAG . CLICKABLE )
115+ self .scan_button .add_state (lv .STATE . DISABLED )
116116 self .scan_button_label .set_text (self .scan_button_scanning_text )
117117 _thread .stack_size (mpos .apps .good_stack_size ())
118118 _thread .start_new_thread (self .scan_networks_thread , ())
@@ -162,8 +162,8 @@ def password_page_result_cb(self, result):
162162
163163 def start_attempt_connecting (self , ssid , password ):
164164 print (f"start_attempt_connecting: Attempting to connect to SSID '{ ssid } ' with password '{ password } '" )
165- self .scan_button .remove_flag (lv .obj . FLAG . CLICKABLE )
166- self .scan_button_label .set_text (f"Connecting to { ssid } ... " )
165+ self .scan_button .add_state (lv .STATE . DISABLED )
166+ self .scan_button_label .set_text (f"Connecting to ' { ssid } ' " )
167167 if self .busy_connecting :
168168 print ("Not attempting connect because busy_connecting." )
169169 else :
@@ -202,7 +202,7 @@ def attempt_connecting_thread(self, ssid, password):
202202 if self .keep_running :
203203 # Schedule UI updates because different thread
204204 lv .async_call (lambda l : self .scan_button_label .set_text (self .scan_button_scan_text ), None )
205- lv .async_call (lambda l : self .scan_button .add_flag (lv .obj . FLAG . CLICKABLE ), None )
205+ lv .async_call (lambda l : self .scan_button .remove_state (lv .STATE . DISABLED ), None )
206206 lv .async_call (lambda l : self .refresh_list (), None )
207207
208208
@@ -268,7 +268,7 @@ def onCreate(self):
268268 def hide_keyboard (self ):
269269 print ("keyboard_cb: READY or CANCEL or RETURN clicked, hiding keyboard" )
270270 self .keyboard .set_height (0 )
271- self .keyboard .remove_flag (lv .obj . FLAG . CLICKABLE )
271+ self .keyboard .remove_state (lv .STATE . DISABLED )
272272 print ("keyboard_cb: Showing Connect and Cancel buttons" )
273273 self .connect_button .remove_flag (lv .obj .FLAG .HIDDEN )
274274 self .cancel_button .remove_flag (lv .obj .FLAG .HIDDEN )
0 commit comments