wxDirDialog - strange problem

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
Jacek Poplawski
Knows some wx things
Knows some wx things
Posts: 38
Joined: Mon Jun 20, 2011 12:03 pm

wxDirDialog - strange problem

Post by Jacek Poplawski » Sun Jul 29, 2012 4:29 am

I have strange problem with wxDirDialog on my Linux system and I am confused.

I know this code was working properly before and I know that it works now for other person on Windows.
So it must be somehow related to my updated system or strange compiler problem, but maybe you have some idea.

1) I create wxDirDialog
2) I call ShowModal() and make sure it's not ID_CANCEL
3) I call GetPath()

the problem is GetPath returns my home dir! every time, no matter what I choose in dialog.

I read wxWidgets documentation to find any potential problems, any flags to set, etc, etc, but the description of GetPath is:

"Returns the default or user-selected path."

Is it possible that it just returns default path? Why?

I don't have problems with same scenario in wxFileDialog. And I use same wxWidgets version I was using before (2.8.12), there was no update in last month in my distro.

Nelson Joseph
Experienced Solver
Experienced Solver
Posts: 65
Joined: Sun Oct 26, 2008 5:15 am
Location: Chennai, India
Contact:

Re: wxDirDialog - strange problem

Post by Nelson Joseph » Sun Jul 29, 2012 7:44 am

Jacek,

Have you did like this? If not, please post your code snippet.

Code: Select all

wxString path;

if( dialog->ShowModal() == wxID_OK )
{
  path = dialog->GetPath();
}
Regards,
Nelson Joseph

Jacek Poplawski
Knows some wx things
Knows some wx things
Posts: 38
Joined: Mon Jun 20, 2011 12:03 pm

Re: wxDirDialog - strange problem

Post by Jacek Poplawski » Sun Jul 29, 2012 12:08 pm

Code is here:

http://code.google.com/p/delaboratory/s ... logs.cc#99

(function GetDir)

Please note that this code was working for me and it's working for others, I just wonder how it is possible that it stopped working for me now.
Is my system really broken or maybe there is some special case in which it behaves incorrectly and that's the case.

Jacek Poplawski
Knows some wx things
Knows some wx things
Posts: 38
Joined: Mon Jun 20, 2011 12:03 pm

Re: wxDirDialog - strange problem

Post by Jacek Poplawski » Sun Jul 29, 2012 12:48 pm

OK this is not my code specific

I downloaded this:

http://www.wxwidgets.org/downloads/demos.htm

compiled dialogs demo, opened dir and noticed same problem as I have now.

Must be some distro/binary problem.

https://bbs.archlinux.org/viewtopic.php?id=146064

Post Reply