Skip to content
Discussion options

You must be logged in to vote

First you need to get the object pointer:

    uint8_t page = 1;   // the page of the object you want
    uint8_t id   = 150; // the id of the object you want

    lv_obj_t* my_obj = hasp_find_obj_from_page_id(page, id);
    if(!my_obj ) return; // object doesn't exist

Then you can use the object pointer to get the state, for example: lv_btn_get_state(my_obj) which will return the current state.

   lv_state_t  val = lv_btn_get_state(my_obj );
   if (val & LV_STATE_CHECKED) {
        // do something
   } else {
        // do something
   }

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by flexiti
Comment options

You must be logged in to vote
1 reply
@fvanroie
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants