Comments (9)
This is still an issue. Windows 10, python 3.10
from easygui.
This is still happening on windows 10.
A hackish workaround if anyone happens to be looking for this:
import ctypes
import win32gui
import win32con
from pywinauto.findwindows import find_window
def show_window(title):
if os.name != 'nt': return
time.sleep(0.25)
window = None
done = False
attempts = 0
print("Searching for window with title:", title)
while not done:
attempts += 1
if attempts > 50: break
try:
window = find_window(best_match=title)
except:
window = None
continue
if window:
print("Found window", window)
try:
win32gui.SetWindowPos(window, win32con.HWND_TOPMOST, 0, 0, 0, 0, win32con.SWP_SHOWWINDOW | win32con.SWP_NOMOVE | win32con.SWP_NOREPOSITION | win32con.SWP_NOSIZE)
win32gui.SetForegroundWindow(window)
done = True
print("Window set to foreground")
return True
except Exception as e:
print("Error bringing window to front", e)
continue
print("Search done with no result....")
return False
t = threading.Thread(target=show_window,name='WindowFocus',args=['Select a video'])
t.daemon = True
t.start()
chosen = easygui.fileopenbox(default=target+'\\*.webm', title="Select a video", filetypes=[['*.mp4', '*.webm', 'Videos']])
from easygui.
Hmm. As a temporary fix you could have a message in the console (or some prominent place in your GUI if you have one) saying a file box has opened... But my windows 10 box could not replicate it...
from easygui.
@Mrnumbers9 ; Yes, it's an intermittent issue. For me, it went away after playing with some things and rebooting.
I was also in email correspondence with a person named Stav Bar-Sheshet
who was also having the same issue; and another anonymous poster on Stack Overflow, also having the issue.
from easygui.
Good
from easygui.
I am still struggling with the same problem of easygui-dialogs opening in the background using Anaconda with Spyder on Windows 7 (32-bit). In my Programme, I first open a fileopenbox which is always in the background whereas the subsequent multenterbox is always in the foreground. Of course I would like to have the fileopenbox already in the foreground. As long as there is no keyword argument for the desired behaviour within easygui, one workaround could be to apply a raise_window-function as proposed on http://physicalmodelingwithpython.blogspot.de/2015/07/raising-figure-window-to-foreground.html . But what is the figure name of the easygui-dialog that I have to pass to this function?
from easygui.
I have this problem in my application as well: https://github.com/idigbio/idigbio-media-appliance . In my case this is behavior is complicated by the fact that the dialog is spawned by a call to an internal web-service (the UI is an HTML based, not TK). The good news here is that diropenbox always spawns behind the browser window when called, so at least its reproducible. Filesavebox seems to always be in front of the browser though, so its not consistent across box types.
Perhaps adding something like this:
http://stackoverflow.com/questions/1892339/how-to-make-a-window-jump-to-the-front
to the root window before spawning the dialog would work?
from easygui.
@godfoder can we add this fix to fileopenbox as well?
Or perhaps theres a way to expose the localRoot so it can be done by the user?
from easygui.
See also #163 .
from easygui.
Related Issues (20)
- Python-easygui ftbfs in debian with python 3 HOT 1
- choicebox not working under Python 3.10.1 HOT 4
- A problem with easygui in python3.10
- choicebox() bug
- Influence position of buttons on choicebox HOT 10
- Importing pywinauto changes the fileopenbox UI HOT 8
- I need help. HOT 1
- move to collections.abc sooner HOT 3
- Compatibility Issues with Pywinauto HOT 1
- Choicebox options are invisible in dark mode
- Choicebox print [0] HOT 2
- problem on MacOS 10.14, Python 3.9
- ModuleNotFoundError: No module named 'global_state' HOT 4
- Immediate mode organization
- diropenbox and fileopenbox do not display on top
- Feature request: display in-memory images without disk roundtrip
- Progressbar HOT 1
- feature request: changable font
- _tkinter.TclError: couldn't connect to display
- EasyGui 0.98.3 on Python 3.6.8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easygui.