Skip to content

MenuButton colours don't take effect immediately #34

Open
@PFython

Description

@PFython

I found this 'workaround' for setting the colours of the MenuButton menu items (not the button itself) but they only seem to take effect after other GUI events have been triggered, not from the moment the window is created. This gives the effect of colours apparently changing randomly from default white background to the desired theme colours...

[cleversetup] easypypi/easypypi.py (Lines 900-917)



def set_menu_colours(window):
    """ Sets the colours of MenuButton menu options """
    background = "#2c2825"
    foreground = "#fdcb52"
    try:
        for menu in [
            "1) Upversion",
            "3) Publish",
            "Create Accounts",
            "Browse Files",
        ]:
            window[menu].TKMenu.configure(
                fg=foreground,
                bg=background,
            )
    except:
        pass  # This workaround attempts to change a non-existent menu

Open in IDE · Open on GitHub

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions