473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

empty window when using askopenfile

Is there any way to minimize/hide the annoying default, empty Tk
window that shows behind the native file opening dialog , when using
askopenfile, etc, in tkCommonDialog?

I am using Python 2.3.2 on winXP.

Thanks in advance,
Sorin Gherman
Jul 18 '05 #1
3 3713
Sorin Gherman wrote:
Is there any way to minimize/hide the annoying default, empty Tk
window that shows behind the native file opening dialog , when using
askopenfile, etc, in tkCommonDialog?


import Tkinter, tkFileDialog
root = Tkinter.Tk()
root.withdraw()
tkFileDialog.askopenfile()

Peter

Jul 18 '05 #2
Sorin Gherman wrote:
Is there any way to minimize/hide the annoying default, empty Tk
window that shows behind the native file opening dialog , when using
askopenfile, etc, in tkCommonDialog?


explicitly create the root window, and withdraw it from the
screen before you call askopenfile:

import Tkinter

root = Tkinter.Tk()
root.withdraw()

file = tkFileDialog.askopenfile(...)

</F>

Got Tkinter questions?
http://mail.python.org/mailman/listinfo/tkinter-discuss
has the answers.


Jul 18 '05 #3
s_*******@yahoo.com (Sorin Gherman) wrote in message news:<ac**************************@posting.google. com>...
Is there any way to minimize/hide the annoying default, empty Tk
window that shows behind the native file opening dialog , when using
askopenfile, etc, in tkCommonDialog?

Ah, the pesky Tk root window. You can minimize it, but I don't think
you can make it disappear completely (without nuking the rest of Tk).

Try this-

import Tkinter, tkFileDialog

tkroot = Tkinter.Tk()
tkroot.iconify()

tkFileDialog.askopenfile()

# If you're not doing anything with Tk besides prompting for the file,
# you'll want to get ride of the root window after askopenfile-
tkroot.destroy()
Alternately, you could just put a pretty picture in the root window
and call it a feature =)
Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: tornado | last post by:
Hello all, I am not able to find the solution to this problem :(. I have two php pages . On the first page i am getting some values in $_SESSION when i use print_r function. I don't get the...
2
by: Marc | last post by:
Hi all, I can't figure this out. I want the ability to delete an item in a listbox and leave the window area blank, like it is when the listbox is first created and nothing selected. Right...
10
by: Chuck | last post by:
I have a macro that saves data to an A: drive. If the drive is empty and I run the macro, the drive clicks a few times, and a message comes up saying "the file already exists, do I want to over...
2
by: Frank | last post by:
Hi When creating a MFC MDI application through the wizard, I get an application that starts with a new/empty document/view. How should I edit code so that to start without it ? that is with...
7
by: Brad | last post by:
When debugging my current web project, in VS2003, I found I had lost the ability to drill down on watch objects in the Watch Window; I could only view the single value specific watch objects. ...
8
by: Ricky K. Rasmussen | last post by:
Hi NG, In a very large ASP.NET application i use popups for displaying diffrent kinds of dialogs. But sometimes when a Popup is opened it's like the aspx page is never executed and the popup...
4
by: Raed Sawalha | last post by:
Dear : In my web page I'm always checking the referer page if it was empty I do something else also I do something :0). the problem in my ASPX page client side I did a popup window, and when...
10
by: Charles Hunt | last post by:
Hi, When running this code in VB2003 Sub guidtest() Dim gstring As String Dim gid As Guid
1
by: gluggi | last post by:
Hi, I have a small problem when I try to save a file. In an ASPX page in the Page_Load method I do something like that: (VB) Response.ClearHeaders() Response.AddHeader("Content-Disposition",...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.