Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
7 of 9 tasks
jason990420 opened this issue Feb 21, 2024 · 2 comments

Comments

@jason990420
Copy link
Collaborator

jason990420 commented Feb 21, 2024

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 !

@jason990420 jason990420 changed the title [Question] Content of Input and Multiline elements with option do_not_clear=True, cleared when CalendarButton clicked [Question] Input and Multiline elements with option do_not_clear=True, cleared when CalendarButton clicked Feb 21, 2024
@jason990420 jason990420 changed the title [Question] Input and Multiline elements with option do_not_clear=True, cleared when CalendarButton clicked [Question] Input and Multiline elements with option do_not_clear=False, cleared when CalendarButton clicked Feb 21, 2024
@Jerry1111111
Copy link

it's 'do_not_clear'. so if setting to false, it will be cleared ; )

@jason990420
Copy link
Collaborator Author

it's 'do_not_clear'. so if setting to false, it will be cleared ; )

I knew it, It's not my question here.

The question is

  • Need to input some data, include the date selected by CalendarButton.
  • Need those Input and Multiline elements with option do_not_clear=False to be clear after each record Add.

then

Other data entried will be clear if there's one calendar data selected by that CalendarButton.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants