[wxPython-users] DirDialog problem on same dir?

Robin Dunn robin at alldunn.com
Mon May 14 18:50:05 PDT 2007


Bob Robison wrote:
> I have a wx.DirDialog opening, with wx.DD_DIR_MUST_EXIST style (not
> sure that matters).   I open this dialog, and select the directory I
> want for further processing.  I am saving off the directory using
> GetPath, and later when the user wants to select a directory again, I
> pass that as the starting directory.
> 
> This works fine, and the dialog shows up on the right directory.
> However, if I just try to select 'OK' and process the same directory
> again, the dialog does not accept the OK button.  I can cancel, and
> the dialog closes.  I can double-click on a different directory (as
> long as it is not a parent of the first directory, from the path
> along the top), and *then* click back on the directory I want, it
> will be OK -- but for some reason I cannot just click OK when the
> dialog first opens.
> 
> Actually, I just verified that even on the first opening of the
> dialog, if I just try to accept that initial defaultPath (set in
> constructor call), then the OK button is not accepted.  Am I missing
> something, or is this a bug?  (v2.8.3 - on kubuntu Linux).
> 

Yes, this is a known oddity of how the GTK dir dialog works.  Basically 
the way the dialog works you need to select the target dir, but not 
double click to go "into" it, but when you pass the starting dir the 
dialog moves all the way into the target dir so to make it work you have 
to move up one level.  The GTK dir dialog has the same problem in other 
apps too.


-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list