Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'patterns': 0.04; 'output': 0.05; 'subject:file': 0.07; 'tkinter': 0.07; '__name__': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'screen.': 0.09; 'windows,': 0.09; 'python': 0.11; 'def': 0.12; 'jan': 0.12; 'windows': 0.15; "'__main__':": 0.16; '*must*': 0.16; 'bugs.': 0.16; 'hits': 0.16; 'itself,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'right-click': 0.16; 'time"': 0.16; 'wrote:': 0.18; 'app': 0.19; 'skip:f 30': 0.19; 'import': 0.22; 'header:User-Agent:1': 0.23; 'skip:l 30': 0.24; 'skip:_ 20': 0.27; 'header:X-Complaints-To:1': 0.27; 'header :In-Reply-To:1': 0.27; 'compared': 0.30; 'especially': 0.30; 'code': 0.31; "skip:' 10": 0.31; 'behaving': 0.31; 'dialog': 0.31; 'minor': 0.31; 'sites.': 0.31; 'file': 0.32; 'class': 0.32; 'skip:c 30': 0.32; 'skip:m 30': 0.32; 'open': 0.33; 'skip:_ 10': 0.34; 'problem': 0.35; 'subject: (': 0.35; 'problem.': 0.35; 'johnson': 0.35; 'idle': 0.36; 'searching': 0.37; 'easily': 0.37; 'expected': 0.38; 'to:addr:python-list': 0.38; 'files': 0.38; 'pm,': 0.38; 'received:71': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'skip:t 30': 0.61; 'full': 0.61; 'save': 0.62; 'became': 0.64; 'more': 0.64; 'within': 0.65; 'click': 0.77; '"one': 0.84; '(hint:': 0.84; 'investigated': 0.84; 'proves': 0.84; 'received:fios.verizon.net': 0.84; 'rick': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Idle open file dialogs (was ...) Date: Sun, 20 Jul 2014 22:59:11 -0400 References: <232acf45-096d-466a-aa75-06d8c378b128@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-71-175-90-87.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: <232acf45-096d-466a-aa75-06d8c378b128@googlegroups.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 81 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1405911566 news.xs4all.nl 2889 [2001:888:2000:d::a6]:33893 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:74898 On 7/20/2014 5:14 PM, Rick Johnson wrote: Idle's Open file dialog is not modal. More than one can be open at one time. The all open as the same place. They can all be hidden by other windows, including the parent, especially if the parent is full screen. These might or might not be design bugs, I do not know that any are implementation bugs. They are definitely minor issues compared to some other Idle issues. > Modal dialogs *MUST* be limited to a "one dialog at a time" These are not modal. > If for some reason IDLE is not using the tkFileDialogs, Easily investigated from within Idle itself, using Find in Files Alt+F3 to search for tkFileDialog in idlelib, which became tkinter.filedialog in 3.x. Searching 'tkFileDialog' in lib/idlelib/*.py ... lib/idlelib\IOBinding.py: 7: import tkinter.filedialog as tkFileDialog lib/idlelib\IOBinding.py: 496: self.opendialog = tkFileDialog.Open(master=self.text, lib/idlelib\IOBinding.py: 516: self.savedialog = tkFileDialog.SaveAs( lib/idlelib\configHelpSourceEdit.py: 8: import tkinter.filedialog as tkFileDialog lib/idlelib\configHelpSourceEdit.py: 94: opendialog = tkFileDialog.Open(parent=self, filetypes=filetypes) Hits found: 5 (Hint: right-click to open locations.) As the output says, a right click will take one to the usage sites. > # The following code proves that Tkinter filedialogs are > # behaving in expected manners (properly placed as children > # of the windows which "own" them, and following normal > # focus patterns of "child windows" -- therfore, the problem > # *MUST* be an IDLE problem. > # > # Tested on Python 2.7.8 > # > import Tkinter as tk > from tkFileDialog import askopenfilename, asksaveasfilename > > class App(tk.Tk): > def __init__(self): > tk.Tk.__init__(self) > self._createMenus() > > def _createMenus(self): > menubar = tk.Menu(self) > self.config(menu=menubar) > filemenu = tk.Menu(menubar) > menubar.add_cascade(label='File', menu=filemenu) > filemenu.add_command(label='Open', command=self.requestOpenDialog) > filemenu.add_command(label='Save As', command=self.requestSaveAsDialog) > > def _requestFileDialog(self, func, **kw): > path = func(**kw) > return path > > def requestOpenDialog(self, **kw): > return self._requestFileDialog(askopenfilename, **kw) > > def requestSaveAsDialog(self, **kw): > return self._requestFileDialog(asksaveasfilename, **kw) > > if __name__ == '__main__': > app = App() > app.mainloop() I will save this to look at some time. -- Terry Jan Reedy