[Tkinter-discuss] tkFileDialog: shuts down root window

mopman dnichols32 at comcast.net
Wed Dec 27 22:02:00 CET 2006


I believe I have the missing piece to this puzzle.  This only happens when
selecting files from the Desktop.  If I'm selecting files from any other
location it is fine.

To repeat:
1) in the code that I submitted, change the initialdir to your python dir:
e.g. 'C:\\Python24'
2) run code  -  window appears
3) click Browse button  -  filedialog appears
4) click Desktop button on left hand side of file dialog  - changes to
Desktop location 
5) select a file from list and click Open (you can also double click on file
to select it doesn't matter) - path is displayed in Entry field
6) click Browse button again
7) click Desktop button again
8) Now here it is - slowly move cursor to a filename in the list - as soon
as cursor is over file the application shuts down.

My observations: 1) It takes two times selecting a file from the desktop for
this to happen.  2) It seems to happen on the second time as soon as the pop
up displays the file info (i.e. if you move cursor over a file, a pop up
appears with file type, date and size info).  3) This only happens when
selecting from desktop.  I can select files without any problems from any
other location.



Fredrik Lundh wrote:
> 
> mopman wrote:
> 
>> I'm using python tkinter to create a GUI.  I wish to collect 4 files from
>> a
>> user so for this part I created a GUI that has a Label, Entry  and
>> Button. 
>> To get the file I use tkFileDialog askopenfilename.  My problem is that
>> after a few file selections using the tkFileDialog, the root window is
>> destroyed (the whole program just dissappears). 
>> 
>> I have created a simpler example and was able to reproduce the same thing
>> with this.  I've just started using tkinter so I have no idea what I may
>> be
>> doing wrong.  If anyone has any ideas please let me know.
> 
> I don't have Pmw on this machine, but if I comment out the "import Pmw" 
> line, the program works perfectly fine for me (Python 2.4.3, XP, running 
> from the command prompt).
> 
> - do you still get the same problem if you remove the Pmw import ?
> 
> - how do you run the program ?
> 
> </F>
> 
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
> http://mail.python.org/mailman/listinfo/tkinter-discuss
> 
> 

-- 
View this message in context: http://www.nabble.com/tkFileDialog%3A-shuts-down-root-window-tf2863117.html#a8067425
Sent from the Python - tkinter-discuss mailing list archive at Nabble.com.



More information about the Tkinter-discuss mailing list