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

a little bit #46

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CTkScrollableDropdown/ctk_scrollable_dropdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self, attach, x=None, y=None, button_color=None, height: int = 200,
scrollbar=True, scrollbar_button_hover_color=None, frame_border_width=2, values=[],
command=None, image_values=[], alpha: float = 0.97, frame_corner_radius=20, double_click=False,
resize=True, frame_border_color=None, text_color=None, autocomplete=False,
hover_color=None, **button_kwargs):
hover_color=None, topmost : bool = 0, **button_kwargs):

super().__init__(master=attach.winfo_toplevel(), takefocus=1)

Expand Down Expand Up @@ -50,7 +50,8 @@ def __init__(self, attach, x=None, y=None, button_color=None, height: int = 200,
self.attach.winfo_toplevel().bind('<Configure>', lambda e: self._withdraw() if not self.disable else None, add="+")
self.attach.winfo_toplevel().bind("<ButtonPress>", lambda e: self._withdraw() if not self.disable else None, add="+")
self.bind("<Escape>", lambda e: self._withdraw() if not self.disable else None, add="+")

if topmost:
self.attributes("-topmost", 1)
self.attributes('-alpha', 0)
self.disable = False
self.fg_color = customtkinter.ThemeManager.theme["CTkFrame"]["fg_color"] if fg_color is None else fg_color
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ root.mainloop()
| frame_border_color | change the border_color of the frame |
| scrollbar | hide the scrollbar if required, default: True |
| command | add the command when option is selected |
| topmost | always be on top |
| _*Other Parameters_ | _All other parameters for ctkbutton or scrollbar can be passed in dropdownmenu_ |

## Methods
Expand All @@ -120,3 +121,6 @@ root.mainloop()
Show popup menu manually

Note: if you are facing some issues then try using the `CTkScrollableDropdownFrame`.

_Credits goes to [MustafaHilmiYAVUZHAN](https://github.com/MustafaHilmiYAVUZHAN) For small development._