Skip to content

[Question] Input and Multiline elements with option do_not_clear=False, cleared when CalendarButton clicked #6686

@jason990420

Description

@jason990420

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

Question


Operating System

WIN10

PySimpleGUI Port (tkinter, Qt, Wx, Web)

tkinter


Versions

Python version (sg.sys.version)

3.10.2

PySimpleGUI Version (sg.__version__)

5.0.2.2

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

8.6.12


Your Experience In Months or Years (optional)

5+ Years Python programming experience

10+ Years Programming experience overall

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

Anything else you think would be helpful?
None


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
  • None of your GUI code was generated by an AI algorithm like GPT
  • 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
  • Have upgraded to the latest release of PySimpleGUI on PyPI (lastest official version)
  • Tried running the Development Build. Your problem may have already been fixed but not released

Detailed Description

Content of Input and Multiline elements with option do_not_clear=False, cleared when CalendarButton clicked.

IMO, they should not be cleared.

Code To Duplicate

import PySimpleGUI as sg

layout = [
    [sg.Input("Input Element", expand_x=True, do_not_clear=False)],
    [sg.Multiline("Multiline Element", size=(40, 5), expand_x=True, do_not_clear=False)],
    [sg.Input(key='-DATE-', expand_x=True),
     sg.CalendarButton("Date")],
    [sg.Button("Add task")],
]
window = sg.Window("Title", layout)

while True:

    event, values = window.read()

    if event == sg.WIN_CLOSED:
        break

window.close()

Screenshot, Sketch, or Drawing

In the beginning,
image
After CalendarButton Date clicked,
image
Content of Input and Multiline elements cleared !

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething's not rightDone - Install Dev Build (see docs for how)See https://docs.pysimplegui.com/en/latest/documentation/installing_licensing/upgrading/Port - TKPySimpleGUI

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions