Skip to content

[Possible Bug] Tooltip behaves funny when using timeout #2118

@ncotrb

Description

@ncotrb

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

If I use for example window.Read(timeout=500) and want to use set_tooltip in the main loop, the tooltip stays permanently:
tooltip_screenshot

I have also tried this proposed solution: #1402

I intend to check a status every few seconds and display the result in the tooltip.
If there is no workaround for this particular phenomenon, does anyone have any idea how to trigger/call a function if the window was inactive in background and becomes active again? I would really appreciate a solution or tip...

Operating System

Windows 10

Python version

3.7.5

PySimpleGUI Port and Version

PySimpleGUI TK 4.5.0.26

Your Experience Levels In Months or Years

8 MONTHS - Python programming experience
2 YEARS (JavaScript / PHP) - Programming experience overall
NO - Have used another Python GUI Framework (tkiner, Qt, etc) previously (yes/no is fine)?

You have completed these steps:

  • Read instructions on how to file an Issue
  • Searched through main docs http://www.PySimpleGUI.org for your problem
  • Searched through the readme for your specific port if not PySimpleGUI (Qt, WX, Remi)
  • Looked for Demo Programs that are similar to your goal http://www.PySimpleGUI.com
  • Note that there are also Demo Programs under each port on GitHub
  • Run your program outside of your debugger (from a command line)
  • Searched through Issues (open and closed) to see if already reported

Code or partial code causing the problem

import PySimpleGUI as sg
import random

layout = [[sg.Text('This is a sample text.', key='_text_', tooltip='')],
          [sg.Button('Exit')]]

window = sg.Window('Window Title', layout, finalize=True)

while True:
    event, values = window.Read(timeout=500)

    if event in (None, 'Exit'):
        break

    window['_text_'].set_tooltip(random.randint(500, 1000))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions