jarvisteach / appJar

Simple Tkinter GUIs in Python
http://appJar.info
Other
615 stars 68 forks source link

Can't change Fg on button text (Mac) #587

Open MarieCaroline opened 5 years ago

MarieCaroline commented 5 years ago

Bug Report


Hi, I'm not sure whether I'm just missing something obvious but I have run into the following issue/question:

Context


Trying to make a simple UI with a drop down selection and a few buttons.

Expected Behaviour


I would expect adding app.setFg("red", override=True) to set all Fg including the text on buttons and on the drop down menu to red. I would expect app.setButtonFg("Cancel", "black") to set the text on a button to be black.

Actual Behaviour


Neither of the above code causes changes to the text on the buttons and app.setFg("red", override=True) does not change the color of the default text of the drop down menu.

Default behavior with no Fg or Bg changes: Screen Shot 2019-08-20 at 9 48 25 AM Added the following bits of code: app.setFg("red", override=True) app.setButtonFg("Cancel", "black") app.setButtonBg("Cancel", "gray") Screen Shot 2019-08-20 at 9 51 56 AM

Any error messages produced by appJar


No error message

Sample code, demonstrating the issue


from appJar import gui

def press(button):
    if button == "Cancel":
        app.stop()

def startGui():
    app.addLabel("title", "Testing")
    app.setFg("red", override=True) # should change text in option box to red

    app.addLabelOptionBox("Test Steps", ["Apple", "Orange", "Pear", "kiwi",
                                         "Dogs", "Cats", "Fish", "Hamsters"])
    app.addLabelEntry("MAC Address")

    app.addButtons(["Cancel"], press)
    app.setButtonFg("Cancel", "black") # should change button text to black
    app.setButtonBg("Cancel", "gray")
    app.go()

if __name__ == '__main__':
    app = gui("Testing")
    startGui()

What steps are needed to reproduce the bug


Running on Mac the above code should produce the following output: Screen Shot 2019-08-20 at 10 26 37 AM

Version Information


appJar: 0.94.0 Python: 3.7.2 TCL: 8.5, TK: 8.5 Platform: Darwin pid: 15339 locale: en_US

MacOS Mojave 10.14.5 (18F132)

jarvisteach commented 4 years ago

Mac can be very picky about which widgets you can change...

Windows/Linux seem much happier for you to change widgets, but Mac often ignores changes. Buttons are especially problematic.

I'll need to do some checks on these widgets, to see if it's possible...