mirror of
https://github.com/TomSchimansky/CustomTkinter.git
synced 2023-08-10 21:13:13 +03:00
added text_color_disabled to configure of CTkOptionMenu #1559
This commit is contained in:
parent
6d2f31c23c
commit
1960c0b1e0
@ -243,6 +243,10 @@ class CTkOptionMenu(CTkBaseClass):
|
||||
self._text_color = self._check_color_type(kwargs.pop("text_color"))
|
||||
require_redraw = True
|
||||
|
||||
if "text_color_disabled" in kwargs:
|
||||
self._text_color_disabled = self._check_color_type(kwargs.pop("text_color_disabled"))
|
||||
require_redraw = True
|
||||
|
||||
if "dropdown_fg_color" in kwargs:
|
||||
self._dropdown_menu.configure(fg_color=kwargs.pop("dropdown_fg_color"))
|
||||
|
||||
@ -261,8 +265,12 @@ class CTkOptionMenu(CTkBaseClass):
|
||||
|
||||
self._update_font()
|
||||
|
||||
if "command" in kwargs:
|
||||
self._command = kwargs.pop("command")
|
||||
if "dropdown_font" in kwargs:
|
||||
self._dropdown_menu.configure(font=kwargs.pop("dropdown_font"))
|
||||
|
||||
if "values" in kwargs:
|
||||
self._values = kwargs.pop("values")
|
||||
self._dropdown_menu.configure(values=self._values)
|
||||
|
||||
if "variable" in kwargs:
|
||||
if self._variable is not None: # remove old callback
|
||||
@ -277,19 +285,15 @@ class CTkOptionMenu(CTkBaseClass):
|
||||
else:
|
||||
self._variable = None
|
||||
|
||||
if "values" in kwargs:
|
||||
self._values = kwargs.pop("values")
|
||||
self._dropdown_menu.configure(values=self._values)
|
||||
|
||||
if "dropdown_font" in kwargs:
|
||||
self._dropdown_menu.configure(font=kwargs.pop("dropdown_font"))
|
||||
if "state" in kwargs:
|
||||
self._state = kwargs.pop("state")
|
||||
require_redraw = True
|
||||
|
||||
if "hover" in kwargs:
|
||||
self._hover = kwargs.pop("hover")
|
||||
|
||||
if "state" in kwargs:
|
||||
self._state = kwargs.pop("state")
|
||||
require_redraw = True
|
||||
if "command" in kwargs:
|
||||
self._command = kwargs.pop("command")
|
||||
|
||||
if "dynamic_resizing" in kwargs:
|
||||
self._dynamic_resizing = kwargs.pop("dynamic_resizing")
|
||||
|
@ -37,6 +37,7 @@ entry_1.pack(pady=10, padx=10)
|
||||
optionmenu_1 = customtkinter.CTkOptionMenu(frame_1, values=["Option 1", "Option 2", "Option 42 long long long..."])
|
||||
optionmenu_1.pack(pady=10, padx=10)
|
||||
optionmenu_1.set("CTkOptionMenu")
|
||||
optionmenu_1.configure(state="disabled", text_color_disabled="red")
|
||||
|
||||
combobox_1 = customtkinter.CTkComboBox(frame_1, values=["Option 1", "Option 2", "Option 42 long long long..."])
|
||||
combobox_1.pack(pady=10, padx=10)
|
||||
|
Loading…
Reference in New Issue
Block a user