@@ -2337,6 +2337,7 @@ class Button(Element):
23372337
23382338 **Example**
23392339 The program below changes the button's label to "Pushed" when the button is pressed.
2340+
23402341 ```python
23412342 import TkEasyGUI as eg
23422343 button:eg.Button = eg.Button("Push me")
@@ -2346,6 +2347,12 @@ class Button(Element):
23462347 button.set_text("Pushed")
23472348 break
23482349 ```
2350+
2351+ `use_ttk_buttons` parameter is set to `True` by default, which makes buttons look more modern.
2352+ However, on macOS, the default `ttk.Button` has a gray background and does not support changing the background color.
2353+ If you want to change the button color on macOS, set `use_ttk_buttons=False` to use `tk.Button` instead.
2354+ Also, when `use_ttk_buttons=True`, explicit button height settings are ignored due to a `ttk` limitation.
2355+ If you need to control button height, set `use_ttk_buttons=False`.
23492356 """
23502357
23512358 # pylint: disable=too-many-arguments, too-many-locals
@@ -2363,23 +2370,21 @@ def __init__(
23632370 font : Optional [FontType ] = None , # font
23642371 color : Optional [str ] = None , # text color
23652372 text_color : Optional [str ] = None , # same as color
2366- background_color : Optional [
2367- str
2368- ] = None , # background color (not supported on macOS)
2373+ background_color : Optional [str ] = None , # background color (not supported on macOS)
23692374 # pack props
23702375 expand_x : bool = False ,
23712376 expand_y : bool = False ,
23722377 pad : Optional [PadType ] = None ,
23732378 # other
2374- use_ttk_buttons : Optional [ bool ] = None ,
2379+ use_ttk_buttons : bool = True ,
23752380 metadata : Optional [dict [str , Any ]] = None ,
23762381 ** kw ,
23772382 ) -> None :
23782383 """Create a Button element."""
23792384 key = button_text if (key is None ) or (key == "" ) else key
23802385 super ().__init__ ("Button" , "TButton" , key , False , metadata , ** kw )
23812386 # On Windows, ttk buttons look more modern by default.
2382- self .use_ttk = utils . is_win () if use_ttk_buttons is None else use_ttk_buttons
2387+ self .use_ttk = use_ttk_buttons
23832388 self .disabled = False
23842389 if disabled is not None :
23852390 self .props ["disabled" ] = self .disabled = disabled
0 commit comments