diff --git a/CTkScrollableDropdown/ctk_scrollable_dropdown.py b/CTkScrollableDropdown/ctk_scrollable_dropdown.py index a5e4f42..5e897e7 100644 --- a/CTkScrollableDropdown/ctk_scrollable_dropdown.py +++ b/CTkScrollableDropdown/ctk_scrollable_dropdown.py @@ -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) @@ -50,7 +50,8 @@ def __init__(self, attach, x=None, y=None, button_color=None, height: int = 200, self.attach.winfo_toplevel().bind('', lambda e: self._withdraw() if not self.disable else None, add="+") self.attach.winfo_toplevel().bind("", lambda e: self._withdraw() if not self.disable else None, add="+") self.bind("", 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 diff --git a/README.md b/README.md index f9dd71d..edcdeff 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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._ +