example(tabview): fix tabview disable scrollig example

there is no animatin after selecting a tab by clicking anymore
This commit is contained in:
Gabor Kiss-Vamosi
2023-06-26 13:50:43 +02:00
parent 3de61c76af
commit 9491c3ff6d
2 changed files with 0 additions and 19 deletions

View File

@@ -1,15 +1,6 @@
def scroll_begin_event(e):
#Disable the scroll animations. Triggered when a tab button is clicked */
if e.get_code() == lv.EVENT.SCROLL_BEGIN:
a = lv.anim_t.__cast__(e.get_param())
if a:
a.time = 0
# Create a Tab view object
tabview = lv.tabview(lv.scr_act(), lv.DIR.LEFT, 80)
tabview.get_content().add_event_cb(scroll_begin_event, lv.EVENT.SCROLL_BEGIN, None)
tabview.set_style_bg_color(lv.palette_lighten(lv.PALETTE.RED, 2), 0)
tab_btns = tabview.get_tab_btns()