PySimpleGUI / PySimpleGUI/PySimpleGUI

No user icon on file dialog when no_window=True

Open
#3,486 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
13.8k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

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

Bug (small one)

Operating System

Windows 10

Python version

3.83

PySimpleGUI Port and Version

Ports = tkinter

PySimpleGUI Version: 4.30

tkinter version: 8.6.9

You can get these by adding this to the top of your file and running it:

import PySimpleGUI as sg

print(sg)             # Location of your PySimpleGUI.py file
print(sg.version)     # PySimpleGUI version number
print(sg.tclversion_detailed)   # tkinter detailed version number (in PySimpleGUI version 4.29.0+)
print(sg.sys.version) # Python version number

The tkinter version number can be obtained using above code in version 4.29.0+. If your code is prior:

print(sg.tkinter.Tcl().eval('info patchlevel'))
Your Experience Levels In Months or Years

_________ Python programming experience
9 months
_________ Programming experience overall
9 months--picked it up as a humanities researcher

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

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
  • Try again by upgrading your PySimpleGUI.py file to use the current one on GitHub. Your problem may have already been fixed but is not yet on PyPI.
Description of Problem / Question / Details

When calling sg.Popup_get_file(no_window=True, icon='icon.ico'), the file dialog does not have my icon (it has the blue tkinter feather).

However, when no_window=False, the icon is visible in both the new window and the dialog.

Code To Duplicate

A short program that isolates and demonstrates the problem (i.e. please don't paste a link to your 400 line program.... instead paste your 10 line program in full).

Yes, it is a pain to narrow down problems, but it's part of the debugging process. Help me help you by providing something that can be executed so that work on getting you a fix or a workaround can immediately begin.

This pre-formatted code block is all set for you to paste in your bit of code:

import PySimpleGUI as sg

sg.set_options(icon='icon.ico')
sg.popup_get_file('I see the icon here, and it is transferred to dialog.') #click "Browse", then cancel the dialog and the window

sg.popup_get_file('but when setting no-window', no_window=True) 

I have to add that I have been enjoying PySimpleGui very much. I have made a few complicated tkinter apps related to my digital humanities research and it was difficult to get used to thinking in terms of an event loop rather than callbacks. I have come to really apreciate PySimpleGui and the time it has saved me.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the sg.popup_get_file and sg.Popup_get_file entry points, comparing the no_window=True path with the normal path and the icon set by sg.set_options(icon='icon.ico'). Reproduce the issue on Windows using the supplied example; done when the file dialog displays the requested icon in both modes.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.