filedialog

JFileChooser vs JDialog vs FileDialog

倖福魔咒の 提交于 2019-12-05 19:50:36
I need to know which of the 3 is best for me. My requirements are as follows in order of importance: Save and load files with ease. File type filter during file selection (not afterwards). Look and feel is exactly the same as the native OS L&F. If there is a dialog that I've not mentioned that would be more ideal, please let me know. What is the rest of your application written in? If you used AWT you should use FileDialog . If you used Swing you should use JFileChooser . Both classes meet all of your requirements. (A JDialog is simply an empty window, you can only use it to open files if you

pyplot.show() reopens old tkinter dialog

前提是你 提交于 2019-12-05 14:40:40
EDIT: This seems to be a problem restricted to Tcl/Tk on Mac OS systems. So if you have no experience with that, this topic might be moot... I want to have a Python script that does two things: Ask the user for a file name via a Tkinter file dialog. Plot some data from said file. The problem is, matplotlib uses Tkinter for the graphical representations, and whenever I call pyplot.show() in non-interactive mode, the (before closed) file dialog pops up again. It seems to me like pyplot.show() gathers a list of all Tkinter windows and shows them all. I did not find any help on this however. I

improving JFileChooser under Ubuntu 12.04 (GTK)

余生长醉 提交于 2019-12-05 11:05:45
I have a problem with the JFileChooser under Ubuntu 12.04. I use this code to set the look and feel: javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName()); And it looks like this. It's very uncomfortable to use and it looks very ugly: http://www9.picfront.org/token/9sRH/2012/05/15/2062476.jpg I would like it to look like this: http://www4.picfront.org/token/1lpa/2012/05/15/2062477.jpg Using the hint from this post , I tried to use FileDialog instead of the FileChooser . But FileDialog throws an exception when i start it in LOAD mode and click on the "open"

How retrieve only filename from save file dialog [duplicate]

房东的猫 提交于 2019-12-04 23:33:34
问题 This question already has answers here : Obtaining only the filename when using OpenFileDialog property “FileName” (2 answers) Closed 2 years ago . I have a save file dialog and i want to get only the filename entered. Equivalent for openfiledialog.SafeFileName; Save file dialog has no SafeFileName Property and FileName returns both filename, path and extension. Pls how do i extract only file name. 回答1: If you want the filename with extension use Path.GetFileName() . If you want it without

PyQt4 File select widget

断了今生、忘了曾经 提交于 2019-12-03 16:25:29
问题 I want to make a QT4 (using QT designer) dialog, that contains a part where a file has to be selected. Now, I know QFileDialog exists, and I can program something that does what I want. But can I also just do it in QT designer? Is there some way to get a "file select" widget in QT designer? Or, I remember these buttons, having the selected file as a title and a little arrow allowing the user to select another file by the QFileDialog? So is there a ready made solution, or do I have to program

How retrieve only filename from save file dialog [duplicate]

﹥>﹥吖頭↗ 提交于 2019-12-03 15:26:45
This question already has an answer here: Obtaining only the filename when using OpenFileDialog property “FileName” 2 answers I have a save file dialog and i want to get only the filename entered. Equivalent for openfiledialog.SafeFileName; Save file dialog has no SafeFileName Property and FileName returns both filename, path and extension. Pls how do i extract only file name. If you want the filename with extension use Path.GetFileName() . If you want it without the extension as well use Path.GetFileNameWithoutExtension() . public void Test(string fileName) { string path = Path

PyQt4 File select widget

南笙酒味 提交于 2019-12-03 04:52:33
I want to make a QT4 (using QT designer) dialog, that contains a part where a file has to be selected. Now, I know QFileDialog exists, and I can program something that does what I want. But can I also just do it in QT designer? Is there some way to get a "file select" widget in QT designer? Or, I remember these buttons, having the selected file as a title and a little arrow allowing the user to select another file by the QFileDialog? So is there a ready made solution, or do I have to program it myself? There is no file dialog available from the Qt designer as far as I know. But you can easily

Does WPF have a native file dialog?

感情迁移 提交于 2019-12-03 02:34:38
问题 Under System.Windows.Controls , I can see a PrintDialog However, I can't seem to find a native FileDialog . Do I need to create a reference to System.Windows.Forms or is there another way? 回答1: WPF does have built-in (although not native ) file dialogs. Specifically, they are in the slightly unexpected Microsoft.Win32 namespace (although still part of WPF). See the OpenFileDialog and SaveFileDialog classes in particular. Do however note that these classes are only wrappers around the Win32

Does WPF have a native file dialog?

被刻印的时光 ゝ 提交于 2019-12-02 16:08:14
Under System.Windows.Controls , I can see a PrintDialog However, I can't seem to find a native FileDialog . Do I need to create a reference to System.Windows.Forms or is there another way? WPF does have built-in (although not native ) file dialogs. Specifically, they are in the slightly unexpected Microsoft.Win32 namespace (although still part of WPF). See the OpenFileDialog and SaveFileDialog classes in particular. Do however note that these classes are only wrappers around the Win32 functionality, as the parent namespace suggests. It does however mean that you don't need to do any WinForms

Get a file's directory in a string selected by askopenfilename

雨燕双飞 提交于 2019-12-02 05:51:36
问题 I'm making a program that you use the askopenname file dialog to select a file, which I then want to save the directory to a string so I can use another function (which I already made) to extract the file to a different location that is predetermined. My button code that opens the file dialog is this: `a = tkinter.Button(gui, command=lambda: tkinter.filedialog.askopenfilename(initialdir='C:/Users/%s' % user))` 回答1: This should be what you want: import tkinter import tkinter.filedialog import