Search code examples
pythonbuttonpopuppysimplegui

pysimplegui popup button_justification problem


According to the documentation of PySimpleGUI, the popup element should have an argument called button_justification, which position the button in 'right' or 'left', or 'center' within the popup window.

When i added button_justification='center' to the popup element in my project it raised the error: popup() got an unexpected keyword argument 'button_justification'. What's the problem?

Image


Solution

  • Not all enhancements added into the PyPI version. Download from GitHub

    There is code in the PySimpleGUI package that upgrades your previously pip installed package to the latest version checked into GitHub. You can use the commands psgmain to run the test harness or psgupgrade to invoke the GitHub upgrade code.

    or, you can call sg.main(), like

    d:\>python
    Python 3.10.2 (tags/v3.10.2:a58ebcc, Jan 17 2022, 14:12:15) [MSC v.1929 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import PySimpleGUI as sg
    >>> sg.main()
    

    enter image description here