Git Product home page Git Product logo

Comments (5)

kisvegabor avatar kisvegabor commented on June 20, 2024 1

Actually lv_button_bind_checked should work for buttons, switches and checkboxes too. It just binds the LV_STATE_CHECKED state of the widget. I think we should rather call this function lv_obj_bind_checked. What do you think?

cc @liamHowatt

from lvgl.

kisvegabor avatar kisvegabor commented on June 20, 2024 1

@liamHowatt It seems all good. Could you send a PR?

from lvgl.

liamHowatt avatar liamHowatt commented on June 20, 2024

Switch and checkbox are checkable by default. lv_obj_add_flag(btn, LV_OBJ_FLAG_CHECKABLE) is needed before lv_button_bind_checked on a button. Meanwhile lv_button_bind_checked works "out of the box" on checkboxes. Since there's nothing about the implementation of lv_button_bind_checked that relies on anything button-specific, and works "out of the box" on those widgets other than button, yes I think it's a good idea to rename it to lv_obj_bind_checked.

Might be good to mention the LV_OBJ_FLAG_CHECKABLE flag in the docstring of lv_obj_bind_checked.

from lvgl.

lvgl-bot avatar lvgl-bot commented on June 20, 2024

We need some feedback on this issue.

Now we mark this as "stale" because there was no activity here for 14 days.

Remove the "stale" label or comment else this will be closed in 7 days.

from lvgl.

kisvegabor avatar kisvegabor commented on June 20, 2024

The Pull request is merged. Closing this issue.

from lvgl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.