PySimpleGUI icon indicating copy to clipboard operation
PySimpleGUI copied to clipboard

[ Bug ] line 17374, in Print; AttributeError: '_DebugWin' object has no attribute 'quit_button'

Open henriquelino opened this issue 3 years ago • 3 comments

Type of Issue (Enhancement, Error, Bug, Question)

Bug


Operating System

Windows

PySimpleGUI Port (tkinter, Qt, Wx, Web)

tkinter


Versions

Python version: 3.9.7 (default, Sep 16 2021, 16:59:28) [MSC v.1916 64 bit (AMD64)] port: tkinter tkinter version: 8.6.9 PySimpleGUI version: 4.60.3 PySimpleGUI filename: D:\git\CANT_SHOW\venv\lib\site-packages\PySimpleGUI\PySimpleGUI.py

Python version (sg.sys.version)

3.9.7 (default, Sep 16 2021, 16:59:28) [MSC v.1916 64 bit (AMD64)]

PySimpleGUI Version (sg.__version__)

4.60.3

GUI Version (tkinter (sg.tclversion_detailed), PySide2, WxPython, Remi)

8.6.9


Your Experience In Months or Years (optional)

Years Python programming experience

Years Programming experience overall

Have used another Python GUI Framework? (tkinter, Qt, etc) (yes/no is fine)

Anything else you think would be helpful?


Troubleshooting

These items may solve your problem. Please check those you've done by changing - [ ] to - [X]

  • [ ] Searched main docs for your problem www.PySimpleGUI.org
  • [ ] Looked for Demo Programs that are similar to your goal. It is recommend you use the Demo Browser! Demos.PySimpleGUI.org
  • [ ] If not tkinter - looked for Demo Programs for specific port
  • [ ] For non tkinter - Looked at readme for your specific port if not PySimpleGUI (Qt, WX, Remi)
  • [ ] Run your program outside of your debugger (from a command line)
  • [ ] Searched through Issues (open and closed) to see if already reported Issues.PySimpleGUI.org
  • [x] Have upgraded to the latest release of PySimpleGUI on PyPI (lastest official version)
  • [ ] Tried using the PySimpleGUI.py file on GitHub. Your problem may have already been fixed but not released

Detailed Description

no_button arg causing easy_print to break

I think the bug came with the 4.60 update?

Traceback: File "D:\git......\venv\lib\site-packages\PySimpleGUI\PySimpleGUI.py", line 17374, in Print self.quit_button.BType = BUTTON_TYPE_CLOSES_WIN_ONLY AttributeError: '_DebugWin' object has no attribute 'quit_button'

Code To Duplicate


sg.easy_print("test", no_button=True)

Screenshot, Sketch, or Drawing


Watcha Makin?

If you care to share something about your project, it would be awesome to hear what you're building.

henriquelino avatar Jul 29 '22 02:07 henriquelino

With option no_button=True, there's no attribute _DebugWin.quit_button.

It looks that The call to _DebugWin.Print will be always failed if _DebugWin initiated with option no_button=True.

If nothing wrong, it was updated when

    4.59.0.1
        Addition of the blocking parameter to the Print function. Enables using Print through an entire program with the last
            Print call setting the blocking parameter so that the window doesn't close until user interacts with the Debug Output Window

jason990420 avatar Jul 29 '22 05:07 jason990420

Posted 4.60.3.70 with a fix.

PySimpleGUI avatar Jul 29 '22 11:07 PySimpleGUI

tysm

henriquelino avatar Aug 03 '22 19:08 henriquelino