Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CheckBoxMenuImplementation.mark_item_as_checked() is a misnommer #119

Closed
lenormf opened this issue May 24, 2021 · 1 comment
Closed

CheckBoxMenuImplementation.mark_item_as_checked() is a misnommer #119

lenormf opened this issue May 24, 2021 · 1 comment
Assignees
Labels
Bug Something isn't working Popups Add for issues having to do with popups Widgets Add for issues having to do with widgets
Milestone

Comments

@lenormf
Copy link

lenormf commented May 24, 2021

Describe the bug
CheckBoxMenuImplementation.mark_item_as_checked() toggles the checked status of a given item.

To Reproduce
Steps to reproduce the behaviour:

  1. Call mark_item_as_checked() twice, the item will still be unchecked

Expected behavior

I implemented the following methods on my overloaded widget, I think the naming makes more sense:

    def check_item(self, item):
        self._selected_item_dict[item] = True

    def uncheck_item(self, item):
        self._selected_item_dict[item] = False

    def toggle_item(self, item):
        self._selected_item_dict[item] = not self._selected_item_dict[item]
@lenormf lenormf added the Bug Something isn't working label May 24, 2021
@jwlodek jwlodek self-assigned this May 26, 2021
@jwlodek jwlodek added this to the v0.1.4 milestone May 26, 2021
@jwlodek jwlodek added Popups Add for issues having to do with popups Widgets Add for issues having to do with widgets labels May 26, 2021
@jwlodek jwlodek mentioned this issue Jun 10, 2021
3 tasks
@jwlodek
Copy link
Owner

jwlodek commented Oct 2, 2021

This issue has been resolved on the v0.1.4 branch, and is awaiting merging. The following functions are now available:

    def toggle_item_checked(self, item: Any):
        """Function that marks an item as selected

        Parameters
        ----------
        item : object
            Toggle item checked state
        """

        self._selected_item_dict[item] = not self._selected_item_dict[item]


    def mark_item_as_checked(self, item: Any) -> None:
        """Function that marks an item as selected

        Parameters
        ----------
        item : object
            Toggle item checked state
        """

        self._selected_item_dict[item] = True


    def mark_item_as_not_checked(self, item) -> None:
        """Function that marks an item as selected

        Parameters
        ----------
        item : object
            Item to uncheck
        """

        self._selected_item_dict[item] = False

@jwlodek jwlodek closed this as completed Oct 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Popups Add for issues having to do with popups Widgets Add for issues having to do with widgets
Projects
None yet
Development

No branches or pull requests

2 participants