Skip to content

MenuButton colours don't take effect immediately #34

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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