TomSchimansky / TomSchimansky/CustomTkinter

self.focus_set() and self.grab_set() in ctkoptionmenu make bug my app :(

Open
#2,064 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
13.6k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

i have to wirte this line like comment in ctkoptionmenu.py becuz when i click to see the menu, all of my app bug.

       # self.grab_set()
       # self.focus_set()

see with wiki code.
version = "5.1.2"

entry=ctk.CTkOptionMenu(self,
                                      values=layer_values,
                                      command=self.optionmenu_callback)
entry.grid(row=count,column=1)
    def _on_enter(self, event=0):
        if self._hover is True and self._state == tkinter.NORMAL and len(self._values) > 0:
            # set color of inner button parts to hover color
            self._canvas.itemconfig("inner_parts_right",
                                    outline=self._apply_appearance_mode(self._button_hover_color),
                                    fill=self._apply_appearance_mode(self._button_hover_color))
           # self.grab_set()
           # self.focus_set()

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in ctkoptionmenu.py at _on_enter, using the provided CustomTkinter 5.1.2 CTkOptionMenu example to reproduce the failure with self.grab_set() and self.focus_set() enabled. Compare the menu behavior with those calls active and commented out, then verify that opening the menu no longer breaks the application while its expected interaction remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.