How do I add widgets to a file dialog in wxpython?

I think you are going the wrong way about this. In general extra widgets aren't ment to be added to the standard dialogs (they wouldn't really be standard if you could) If you wish to add wx. CheckBox s or the like the you going to have to create your own custom dialog by subclassing wx.

Dialog If all you need to do is to provide the user with a means of filtering by file-types to be opened or select which file-type the file is to be saved as, then this functionality is all ready provided by wx. FileDialog By using the wildcard paramater when creating an instance of your fileDialog you can supply a group of file-types for the user to choose from Here's a snippet from the wxPython Demo and a screenshot to illustrate. The wxPython Demo is very usefull application which provides demos of most of the widgets included with wxPython, a worthwhile download if you don't already have it wildcard = "Python source (*.

Py)|*. Py|" \ "Compiled Python (*. Pyc)|*.

Pyc|" \ "SPAM files (*. Spam)|*. Spam|" \ "Egg file (*.

Egg)|*. Egg|" \ "All files (*. *) wx.

FileDialog Documentation: http://wxpython.org/docs/api/wx.FileDialog-class.html http://xoomer.virgilio.it/infinity77/wxPython/Widgets/wx.FileDialog.html.

I think you are going the wrong way about this. In general extra widgets aren't ment to be added to the standard dialogs (they wouldn't really be standard if you could). If you wish to add wx.

CheckBox's or the like the you going to have to create your own custom dialog by subclassing wx.Dialog. If all you need to do is to provide the user with a means of filtering by file-types to be opened or select which file-type the file is to be saved as, then this functionality is all ready provided by wx.FileDialog. By using the wildcard paramater when creating an instance of your fileDialog you can supply a group of file-types for the user to choose from.

Here's a snippet from the wxPython Demo and a screenshot to illustrate. The wxPython Demo is very usefull application which provides demos of most of the widgets included with wxPython, a worthwhile download if you don't already have it. Wildcard = "Python source (*.

Py)|*. Py|" \ "Compiled Python (*. Pyc)|*.

Pyc|" \ "SPAM files (*. Spam)|*. Spam|" \ "Egg file (*.

Egg)|*. Egg|" \ "All files (*. *)|*.

*" wx. FileDialog Documentation: http://wxpython.org/docs/api/wx.FileDialog-class.html http://xoomer.virgilio.it/infinity77/wxPython/Widgets/wx.FileDialog.html.

What you wrote about adding extra widgets is not true on most of the modern platforms. Windows, GTK, Qt and I think also Carbon and Cocoa support adding extra widgets to file dialogs. It was also implemented in wxWidgets a few years ago, as a part of one of the Google Summer of Code projects.

– marcin May 9 at 22:51.

I agree with volting. If you need a custom (NOT native) dialog, subclass wx.Dialog. Otherwise, use the standard dialogs the way they're supposed to be used.

See also: blog.pythonlibrary.org/2010/06/26/the-di... blog.pythonlibrary.org/2010/07/10/the-di....

In wxWidgets 2.9 custom controls can be added to file dialogs using wxFileDialog::SetExtraControlCreator(). It's implemented for GTK, MSW and generic dialogs. Alternatively, you may use the wxFileCtrl class.It has native implementation only in wxGTK.

I don't know if these features is available from Python wrappers, though.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions