MCPcopy Index your code
hub / github.com/PySimpleGUI/PySimpleGUI / theme_button_color

Function theme_button_color

PySimpleGUI/PySimpleGUI.py:19750–19770  ·  view source on GitHub ↗

Sets/Returns the button color currently in use :return: (str, str) - TUPLE with color strings of the button color currently in use (button text color, button background color) :rtype: (str, str)

(color=None)

Source from the content-addressed store, hash-verified

19748
19749
19750def theme_button_color(color=None):
19751 """
19752 Sets/Returns the button color currently in use
19753
19754 :return: (str, str) - TUPLE with color strings of the button color currently in use (button text color, button background color)
19755 :rtype: (str, str)
19756 """
19757 if color is not None:
19758 if color == COLOR_SYSTEM_DEFAULT:
19759 color_tuple = (COLOR_SYSTEM_DEFAULT, COLOR_SYSTEM_DEFAULT)
19760 else:
19761 color_tuple = button_color_to_tuple(color, (None, None))
19762 if color_tuple == (None, None):
19763 if not SUPPRESS_ERROR_POPUPS:
19764 popup_error('theme_button_color - bad color string passed in', color)
19765 else:
19766 print('** Badly formatted button color... not a tuple nor string **', color)
19767 set_options(button_color=color) # go ahead and try with their string
19768 else:
19769 set_options(button_color=color_tuple)
19770 return DEFAULT_BUTTON_COLOR
19771
19772
19773def theme_button_color_background():

Callers 13

__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
TitlebarFunction · 0.85
MenubarCustomFunction · 0.85
DebugFunction · 0.85
button_color_to_tupleFunction · 0.85
theme_button_color_textFunction · 0.85

Calls 3

button_color_to_tupleFunction · 0.85
popup_errorFunction · 0.85
set_optionsFunction · 0.85

Tested by

no test coverage detected