Page 1 of 1

exFileDialog wildcard doesn't work on initial entry

Posted: Sun Jun 14, 2009 12:23 am
by jamescobban
I am creating an instance of wxFileDialog in C++ (gcc) on Linux (Ubuntu) with GTK2 and wxWidgets 2.8.10 as follows:

Code: Select all

openFileDialog = new wxFileDialog(this,					"Choose a file", 									"/media/disk-1/Documents and Settings/Jim Cobban/My Documents/FamilyTree",									"Cobban.GED",									"GEDCOM files (*.ged)|*.ged;*.GED",									wxFD_FILE_MUST_EXIST + wxFD_CHANGE_DIR);
I am puzzled because when I pop the dialog up it initially shows every file in the selected directory and the wildcard selection item in the GTK dialog shows blank until I click on it with the mouse, only then does my wildcard selection shows up and the list of files is restricted.

Is there some trick to getting the GTK dialog to honor the wildcard when it is first popped up?

Posted: Mon Jun 15, 2009 2:54 am
by protocol
try it without the semi-colon.

Code: Select all

"GEDCOM files (*.ged)|*.ged|GEDCOM files (*.GED)|*.GED"

Posted: Fri Jul 03, 2009 8:36 pm
by jamescobban
protocol wrote:try it without the semi-colon.

Code: Select all

"GEDCOM files (*.ged)|*.ged|GEDCOM files (*.GED)|*.GED"
This does not give the desired result, as it creates TWO separate items on the selection list when in fact there is only one type, complicated by Bill's decision to support case-insensitive file names.

I still do not have a resolution to this issue. To get around a bug in the current distributed version of wxWidgets I have changed the initialization code slightly, but this does not change the behavior. In detail when the dialog first pops up the display is momentarily correct, that is the filetype selection control shows only the GEDCOM files line and the list of files displayed includes only files with type .ged or .GED, but the display continues to flicker as something in the Gtk2 support code continues to modify the dialog, and once the display settles down the selection control displays blank and the list of files shows all of the files in the directory.

Posted: Sat Jul 04, 2009 3:19 am
by protocol
The other simple solution is to only accept one filetype of the same ext name. Make sure your application saves the file as the desired type. People who use Unix/Linux are aware of case-sensitivity.