TomSchimansky / TomSchimansky/CustomTkinter

OptionMenu doesnt support integers

Open
#959 2 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

\Python\Python310\lib\site-packages\customtkinter\windows\widgets\core_widget_classes\dropdown_menu.py", line 100, in _add_menu_commands
self.add_command(label=value.ljust(self._min_character_width),
AttributeError: 'int' object has no attribute 'ljust'

values or variable doesnt support integers. You can get around it by making each int of the list into a string, and turn it back around afterwards if needed, but seems a bit hacky.

Thx for this project btw. It has replaced my other tkUI skin, its just as nice and more responsive.

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 customtkinter/windows/widgets/core_widget_classes/dropdown_menu.py at _add_menu_commands, where integer values fail because ljust is called on them. Reproduce the issue with integer values or variables in the OptionMenu, then verify that integer options are accepted without requiring callers to convert them to strings.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.