refactor: scr -> screen, act->active, del->delete, remove in obj_clear_flag/state
This commit is contained in:
@@ -3,23 +3,23 @@ def ta_event_cb(e,kb):
|
||||
ta = e.get_target_obj()
|
||||
if code == lv.EVENT.FOCUSED:
|
||||
kb.set_textarea(ta)
|
||||
kb.clear_flag(lv.obj.FLAG.HIDDEN)
|
||||
kb.remove_flag(lv.obj.FLAG.HIDDEN)
|
||||
|
||||
if code == lv.EVENT.DEFOCUSED:
|
||||
kb.set_textarea(None)
|
||||
kb.add_flag(lv.obj.FLAG.HIDDEN)
|
||||
|
||||
# Create a keyboard to use it with one of the text areas
|
||||
kb = lv.keyboard(lv.scr_act())
|
||||
kb = lv.keyboard(lv.screen_active())
|
||||
|
||||
# Create a text area. The keyboard will write here
|
||||
ta = lv.textarea(lv.scr_act())
|
||||
ta = lv.textarea(lv.screen_active())
|
||||
ta.set_width(200)
|
||||
ta.align(lv.ALIGN.TOP_LEFT, 10, 10)
|
||||
ta.add_event(lambda e: ta_event_cb(e,kb), lv.EVENT.ALL, None)
|
||||
ta.set_placeholder_text("Hello")
|
||||
|
||||
ta = lv.textarea(lv.scr_act())
|
||||
ta = lv.textarea(lv.screen_active())
|
||||
ta.set_width(200)
|
||||
ta.align(lv.ALIGN.TOP_RIGHT, -10, 10)
|
||||
ta.add_event(lambda e: ta_event_cb(e,kb), lv.EVENT.ALL, None)
|
||||
|
||||
Reference in New Issue
Block a user