#14525: DirDialog.GetPath() doesn't return the user-selected path

78 views
Skip to first unread message

wxTrac

unread,
Jul 26, 2012, 3:59:12 AM7/26/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525>

#14525: DirDialog.GetPath() doesn't return the user-selected path
--------------------------+-------------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxPython | Version: 2.8.12
Keywords: | Blockedby:
Patch: 0 | Blocking:
--------------------------+-------------------------------------------------
The following snippet always prints the default path, never the user-
selected one:


{{{
dlg = wx.DirDialog(self, 'Export', '/home/michael')
ok = dlg.ShowModal() == wx.ID_OK
if ok:
print dlg.GetPath()
}}}

I'm using a 64 bit version of Fedora 17 (with Gnome 3.4.2) and using the
packages from Fedora's repositories.

It worked when I used it some months ago, but now I have two machines with
similar installs where the method fails. The FileDialog's GetDirectory()
method has also started displaying this behaviour but that can be worked
around by using os.path.dirname(file_dialog.GetPath())


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525>

wxTrac

unread,
Jul 26, 2012, 3:59:28 AM7/26/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:1>

#14525: DirDialog.GetPath() doesn't return the user-selected path
--------------------------+-------------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxPython | Version: 2.8.12
Keywords: | Blockedby:
Patch: 0 | Blocking:
--------------------------+-------------------------------------------------
Changes (by MichaelClerx):

* cc: cell@… (added)



--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:1>

wxTrac

unread,
Jul 26, 2012, 7:29:15 PM7/26/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:2>

#14525: DirDialog.GetPath() doesn't return the user-selected path
--------------------------+-------------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxPython | Version: 2.8.12
Keywords: | Blockedby:
Patch: 0 | Blocking:
--------------------------+-------------------------------------------------

Comment(by vadz):

Works fine for me with 2.9.4 but I don't have exactly the same
configuration to test against. Please retest with 2.9.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:2>

wxTrac

unread,
Jul 27, 2012, 4:12:27 AM7/27/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:3>

#14525: DirDialog.GetPath() doesn't return the user-selected path
--------------------------+-------------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxPython | Version: 2.8.12
Keywords: | Blockedby:
Patch: 0 | Blocking:
--------------------------+-------------------------------------------------

Comment(by MichaelClerx):

Ok, I've been trying but the library has a lot of dependencies so it's
taking some time to build.

Right now the build script is complaining about not being able to find
GStreamer, although it's definitely installed:

{{{

checking for GST... configure: WARNING: GStreamer 0.10 not available,
falling back to 0.8
checking for GST... configure: WARNING: GStreamer 0.8/0.10 not available.
configure: error: GStreamer not available
Error running configure
ERROR: failed building wxWidgets
Traceback (most recent call last):
File "./build-wxpython.py", line 378, in <module>
wxbuild.main(wxscript, build_options)
File "/home/michael/install/wxPython-src-2.9.4.0/build/tools/build-
wxwidgets.py", line 359, in main
"Error running configure")
File "/home/michael/install/wxPython-src-2.9.4.0/build/tools/build-
wxwidgets.py", line 74, in exitIfError
raise builder.BuildError(msg)
BuildError
[root@thinkpad wxPython]# yum list gstreamer*
Loaded plugins: langpacks, presto
Installed Packages
gstreamer.x86_64
0.10.36-1.fc17 @koji-
override-0/$releasever
gstreamer-devel.x86_64
0.10.36-1.fc17 @fedora
gstreamer-plugins-bad-free.x86_64
0.10.23-7.fc17 @updates
gstreamer-plugins-bad-nonfree.x86_64
0.10.22-3.fc17 @rpmfusion-
nonfree
gstreamer-plugins-base.x86_64
0.10.36-1.fc17 @koji-
override-0/$releasever
gstreamer-plugins-good.x86_64
0.10.31-4.fc17 @updates
gstreamer-plugins-ugly.x86_64
0.10.19-1.fc17 @rpmfusion-free
gstreamer-python.x86_64
0.10.19-3.fc17 @koji-
override-0/$releasever
gstreamer-rtsp.x86_64
0.10.8-2.fc17 @koji-
override-0/$releasever
gstreamer-tools.x86_64
}}}


Not to be rude, but if it works in 2.9, is your response going to be "Then
use 2.9"? Because I'd much rather find the origin of this behaviour in
2.8. I'm guessing it's not a problem in wxPython or even wxWidget (since
both versions I have installed seem to have been built sometime in
January, and this would have affected quite a lot of users since then),
but I don't have the know-how to dig into the underlying components
myself.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:3>

wxTrac

unread,
Jul 27, 2012, 5:45:52 AM7/27/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:4>

#14525: DirDialog.GetPath() doesn't return the user-selected path
--------------------------+-------------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxPython | Version: 2.8.12
Keywords: | Blockedby:
Patch: 0 | Blocking:
--------------------------+-------------------------------------------------

Comment(by vadz):

Replying to [comment:3 MichaelClerx]:
> Right now the build script is complaining about not being able to find
GStreamer, although it's definitely installed:

You should be able to just turn off `wxMediaCtrl`. Also, look at
`config.log` to see why exactly does the test fail.

> Not to be rude, but if it works in 2.9, is your response going to be
"Then use 2.9"?

Not really but I personally don't work on 2.8 since a couple of years
already so if the bug is fixed in 2.9, I won't be trying to fix it. So
while you definitely can use 2.8, my ''personal'' advice would definitely
be to use 2.9.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:4>

wxTrac

unread,
Jul 27, 2012, 7:41:55 AM7/27/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:5>

#14525: DirDialog.GetPath() doesn't return the user-selected path
--------------------------+-------------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxPython | Version: 2.8.12
Keywords: | Blockedby:
Patch: 0 | Blocking:
--------------------------+-------------------------------------------------

Comment(by MichaelClerx):

Okay I found the missing gstreamer devel package, but now the install
halts on.. win_gtk?


{{{
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
creating build/temp.linux-x86_64-2.7/src/gtk
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-
size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g
-pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param
=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC
-DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE
-DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL
-D__WXGTK__ -Iinclude -Isrc -I/usr/local/lib/wx/include/gtk2-unicode-2.9
-I/usr/local/include/wx-2.9 -I/usr/include/gtk-2.0
-I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo
-I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0
-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include
-I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng15
-I/usr/include/python2.7 -c src/helpers.cpp -o
build/temp.linux-x86_64-2.7/src/helpers.o -pthread -O3 -pthread
src/helpers.cpp:32:36: fatal error: wx/gtk/private/win_gtk.h: No such file
or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
ERROR: failed building wxPython.

}}}


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:5>

wxTrac

unread,
Jul 27, 2012, 7:45:23 AM7/27/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:6>

#14525: DirDialog.GetPath() doesn't return the user-selected path
--------------------------+-------------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxPython | Version: 2.8.12
Keywords: | Blockedby:
Patch: 0 | Blocking:
--------------------------+-------------------------------------------------

Comment(by vadz):

This looks like a wxPython bug, hopefully Robin can look into this, I
don't really know anything about this myself, sorry.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:6>

wxTrac

unread,
Jul 27, 2012, 7:50:23 AM7/27/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:7>

#14525: DirDialog.GetPath() doesn't return the user-selected path
--------------------------+-------------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxPython | Version: 2.8.12
Keywords: | Blockedby:
Patch: 0 | Blocking:
--------------------------+-------------------------------------------------

Comment(by MichaelClerx):

Replying to [comment:6 vadz]:
> This looks like a wxPython bug, hopefully Robin can look into this, I
don't really know anything about this myself, sorry.
Thanks for your help though, it's much appreciated :)


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:7>

wxTrac

unread,
Aug 20, 2012, 11:38:12 AM8/20/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:8>

#14525: DirDialog.GetPath() doesn't return the user-selected path
--------------------------+-------------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxPython | Version: 2.8.12
Keywords: | Blockedby:
Patch: 0 | Blocking:
--------------------------+-------------------------------------------------

Comment(by biaji):

Same problem here. And I have submit a bug report in fedora's bugzilla at
https://bugzilla.redhat.com/show_bug.cgi?id=849692

Name : wxPython
Version : 2.8.12.0
Release : 2.fc17
Architecture: x86_64


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:8>

wxTrac

unread,
Aug 20, 2012, 1:48:27 PM8/20/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:9>

#14525: DirDialog.GetPath() doesn't return the user-selected path
--------------------------+-------------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxPython | Version: 2.8.12
Keywords: | Blockedby:
Patch: 0 | Blocking:
--------------------------+-------------------------------------------------

Comment(by robind):

Replying to [comment:6 vadz]:
> This looks like a wxPython bug, hopefully Robin can look into this, I
don't really know anything about this myself, sorry.


There is a patch available for wxPython 2.9.4.0 that takes care of the
missing include files in wxGTK builds. It is at
http://sourceforge.net/projects/wxpython/files/wxPython/2.9.4.0/wxPython-
src-2.9.4.1.patch/download

Oh, and for the record, wx.DirDialog.GetPath is working fine for me on
Ubuntu (recent but not newest) with both wxPython 2.8.12.0 and with 2.9.x
from SVN trunk.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:9>

wxTrac

unread,
Aug 21, 2012, 4:26:12 AM8/21/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:10>

#14525: DirDialog.GetPath() doesn't return the user-selected path
--------------------------+-------------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxPython | Version: 2.8.12
Keywords: | Blockedby:
Patch: 0 | Blocking:
--------------------------+-------------------------------------------------

Comment(by MichaelClerx):

Could you try the newest? I've been getting the error in code that worked
fine on fedora 16. If there's anything I could do to help, please let me
know.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:10>

wxTrac

unread,
Aug 24, 2012, 8:16:00 AM8/24/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:11>

#14525: DirDialog.GetPath() doesn't return the user-selected path
--------------------------+-------------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxPython | Version: 2.8.12
Keywords: | Blockedby:
Patch: 0 | Blocking:
--------------------------+-------------------------------------------------

Comment(by sciurius):

Maybe this is related to a similar problem that I encounter using wxPerl.

In a DirDialogue, when you click on a directory in the Places pane, this
directory will be shown in the dialog. The path on top of the dialog shows
the correct path. Note however, that nothing is selected in the main
(right) pane and the Location field is empty. Now click [Open] and the
dialog will return the default path.

This happens with Wx 2.8.12 and Wx 2.9.3.

When I try this with Fedora 16, the selected path is returned, as
expected.

System information: Fedora 17 x86_64 with all updates as of 2012-08-23.
Perl 5.014002, wxPerl 0.9903, Wx 2.008012

Alternative: CitrusPerl 5.14.2, wxPerl 0.9906, Wx 2.009003


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:11>

wxTrac

unread,
Aug 24, 2012, 11:21:39 AM8/24/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:12>

#14525: DirDialog.GetPath() doesn't return the user-selected path
--------------------------+-------------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxPython | Version: 2.8.12
Keywords: | Blockedby:
Patch: 0 | Blocking:
--------------------------+-------------------------------------------------

Comment(by sciurius):

It looks like DeVeDe (http://www.rastersoft.com/programas/devede.html)
shows the same problematic behaviour, and it uses 'raw' Gtk, not
wxWidgets...


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:12>

wxTrac

unread,
Aug 28, 2012, 4:47:00 AM8/28/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:13>

#14525: DirDialog.GetPath() doesn't return the user-selected path
--------------------------+-------------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxPython | Version: 2.8.12
Keywords: | Blockedby:
Patch: 0 | Blocking:
--------------------------+-------------------------------------------------

Comment(by gertjanzwartjes):

The problem seems to lie in the way how you select a directory. If you go
inside the directory you want to select and then click ok, the returned
path will be the default path.

However, if you do not go inside the dir you want to select, but
''actually select it and then click ok'', `GetPath()` will actually return
the selected directory.

This is the behavior I get with Arch Linux, Gnome 3.4.2 and wxPython
2.8.12.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:13>

wxTrac

unread,
Aug 28, 2012, 4:56:45 AM8/28/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:14>

#14525: DirDialog.GetPath() doesn't return the user-selected path
--------------------------+-------------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxPython | Version: 2.8.12
Keywords: | Blockedby:
Patch: 0 | Blocking:
--------------------------+-------------------------------------------------

Comment(by MichaelClerx):

Nice catch! I can confirm this is what happens on Fedora 17, Gnome 3.4.2,
wxPython 2.8.12


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:14>

wxTrac

unread,
Aug 28, 2012, 6:30:17 AM8/28/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:15>

#14525: DirDialog.GetPath() doesn't return the user-selected path
--------------------------+-------------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxPython | Version: 2.8.12
Keywords: | Blockedby:
Patch: 0 | Blocking:
--------------------------+-------------------------------------------------

Comment(by vadz):

OK, so can we just chalk this up to confusing GTK UI and close it? Or does
anybody still think there is a bug here?


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:15>

wxTrac

unread,
Aug 28, 2012, 7:55:51 AM8/28/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:16>

#14525: DirDialog.GetPath() doesn't return the user-selected path
--------------------------+-------------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxPython | Version: 2.8.12
Keywords: | Blockedby:
Patch: 0 | Blocking:
--------------------------+-------------------------------------------------

Comment(by MichaelClerx):

Still a bug. It's not the way the UI is intended to work on GTK.

I just found a post on an Archlinux board that deals with the same issue:
[https://bbs.archlinux.org/viewtopic.php?pid=1151508]

Some quotes:

''I've confirmed that reverting back to gtk2-2.24.10-3 fixes the problem.
Upgrading to 2.24.11-2 reintroduces it. I can't figure out what the issue
is though. I wrote a test GTK program which uses the same file chooser
control as wxWidgets and it works fine on both GTK2 versions''

...

''So the problem seems to stem from the way wxWidgets uses GTK. I have
checked the GTK git repo on the 2.24 branch and there have been a few
recent changes to the file chooser control (gtkfilechooser*.cpp), but none
that seem like they would've affected this behaviour.''


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:16>

wxTrac

unread,
Aug 28, 2012, 5:11:27 PM8/28/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:17>

#14525: wxDirDialog::GetPath() doesn't return the user-selected path
--------------------------+-------------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxGTK | Version: 2.9.3
Keywords: | Blockedby:
Patch: 0 | Blocking:
--------------------------+-------------------------------------------------
Changes (by vadz):

* version: 2.8.12 => 2.9.3
* component: wxPython => wxGTK


Comment:

This is downright mysterious: the diff between 2.24.10 and 2.24.11 is
small and the only possibly relevant change I see is the addition of
"unmap" signal on the toplevel but I have no idea how could it affect us
nor what to do about it. And I don't have 2.24 to debug this...


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:17>

wxTrac

unread,
Aug 29, 2012, 5:40:23 AM8/29/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:18>

#14525: wxDirDialog::GetPath() doesn't return the user-selected path
--------------------------+-------------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxGTK | Version: 2.9.3
Keywords: | Blockedby:
Patch: 0 | Blocking:
--------------------------+-------------------------------------------------

Comment(by gertjanzwartjes):

I would also say that this is certainly a bug; if you go all the way into
a directory and then press ok, it is very confusing that the default
directory will be used. Selecting the dir instead of entering it before
pressing ok is just a workaround I would say.

However mysterious it is indeed...


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:18>

wxTrac

unread,
Sep 2, 2012, 4:00:25 PM9/2/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:19>

#14525: wxDirDialog::GetPath() doesn't return the user-selected path
--------------------------+-------------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxGTK | Version: 2.9.3
Keywords: | Blockedby:
Patch: 0 | Blocking:
--------------------------+-------------------------------------------------

Comment(by sciurius):

Since it is gtk related I filed a but for Fedora.
https://bugzilla.redhat.com/show_bug.cgi?id=853399


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:19>

wxTrac

unread,
Oct 25, 2012, 6:53:56 PM10/25/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:20>

#14525: wxDirDialog::GetPath() doesn't return the user-selected path
--------------------------+-------------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxGTK | Version: 2.9.3
Keywords: | Blockedby:
Patch: 0 | Blocking:
--------------------------+-------------------------------------------------

Comment(by obfuscated):

This is definitely a bug. It is easily reproducible using the dialogs
sample.

Using the following patch, I was able to pinpoint where does it happen:

{{{
Index: src/gtk/dirdlg.cpp
===================================================================
--- src/gtk/dirdlg.cpp (revision 72775)
+++ src/gtk/dirdlg.cpp (working copy)
@@ -47,6 +47,8 @@
chdir(filename);
}

+ wxGtkString
str(gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(widget)));
+
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK);
event.SetEventObject(dialog);
dialog->GetEventHandler()->ProcessEvent(event);
@@ -152,7 +154,13 @@
void wxDirDialog::OnFakeOk( wxCommandEvent &event )
{
if (!gtk_check_version(2,4,0))
+ {
+ wxGtkString
str1(gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(m_widget)));
EndDialog(wxID_OK);
+ wxGtkString
str2(gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(m_widget)));
+ int a=5;
+ a+=5;
+ }
else
wxGenericDirDialog::OnOK( event );
}

}}}
The problem happens after the call to EndDialog in [wiki:OnFakce OnFakeOk.
Using the debugger]I verified that the value of str1 is correct and str2
is wrong. I don't know what exactly happens in EndDialog, as I'm not
familiar with the code, but it definitely breaks it.

Hopefully someone with better knowledge of wxgtk will fix it:)

I'm running Gentoo Amd64, wxGTK 2.8.12 and HEAD of WX_2_8_BRANCH (r72775),
gtk+ 2.24.13.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:20>

wxTrac

unread,
Oct 25, 2012, 7:03:27 PM10/25/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:21>

#14525: wxDirDialog::GetPath() doesn't return the user-selected path
--------------------------+-------------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxGTK | Version: 2.9.3
Keywords: | Blockedby:
Patch: 0 | Blocking:
--------------------------+-------------------------------------------------

Comment(by obfuscated):

After further investigation the call to gtk_widget_hide in
wxWindowGTK::Show breaks it.

I've commented the call to this function and the return value by GetPath
was correct.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:21>

wxTrac

unread,
Oct 25, 2012, 7:21:58 PM10/25/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:22>

#14525: wxDirDialog::GetPath() doesn't return the user-selected path
--------------------------+-------------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxGTK | Version: 2.9.3
Keywords: | Blockedby:
Patch: 0 | Blocking:
--------------------------+-------------------------------------------------

Comment(by vadz):

We should be able to fix this just by remembering the path before hiding
the dialog then. Please test the patch I'm going to commit soon.

Thanks for debugging this!


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:22>

wxTrac

unread,
Oct 25, 2012, 7:26:38 PM10/25/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:23>

#14525: wxDirDialog::GetPath() doesn't return the user-selected path
---------------------------+------------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: closed
Priority: normal | Milestone:
Component: wxGTK | Version: 2.9.3
Resolution: fixed | Keywords:
Blockedby: | Patch: 0
Blocking: |
---------------------------+------------------------------------------------
Changes (by VZ):

* status: new => closed
* resolution: => fixed


Comment:

(In [72779]) Store the selected directory in wxGTK wxDirDialog.

This should help with the selected directory not being remembered since
GTK+ 2.24.11 as apparently gtk_file_chooser_get_filename() doesn't work
any
more now after hiding the dialog -- so call it before doing this and save
the
result.

Also get rid of the ugly and apparently completely unnecessary OnFakeOk().

Closes #14525.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:23>

wxTrac

unread,
Oct 26, 2012, 3:15:23 AM10/26/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:24>

#14525: wxDirDialog::GetPath() doesn't return the user-selected path
---------------------------+------------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: closed
Priority: normal | Milestone:
Component: wxGTK | Version: 2.9.3
Resolution: fixed | Keywords:
Blockedby: | Patch: 0
Blocking: |
---------------------------+------------------------------------------------

Comment(by obfuscated):

It works, thank you for the quick fix.

Is it possible to backport this change to wx2.8's branch?


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:24>

wxTrac

unread,
Oct 26, 2012, 7:54:02 AM10/26/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:25>

#14525: wxDirDialog::GetPath() doesn't return the user-selected path
-----------------------------+----------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: portneeded
Priority: normal | Milestone: 2.8.13
Component: wxGTK | Version: 2.9.3
Resolution: port to stable | Keywords:
Blockedby: | Patch: 0
Blocking: |
-----------------------------+----------------------------------------------
Changes (by vadz):

* status: closed => portneeded
* resolution: fixed => port to stable
* milestone: => 2.8.13


Comment:

It should be but I'd rather leave this to someone else, I have too many
things to do in 2.9.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:25>

wxTrac

unread,
Oct 26, 2012, 12:32:27 PM10/26/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:26>

#14525: wxDirDialog::GetPath() doesn't return the user-selected path
---------------------------+------------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: closed
Priority: normal | Milestone: 2.8.13
Component: wxGTK | Version: 2.9.3
Resolution: fixed | Keywords:
Blockedby: | Patch: 0
Blocking: |
---------------------------+------------------------------------------------
Changes (by PC):

* status: portneeded => closed
* resolution: port to stable => fixed


Comment:

(In [72781]) Store the selected directory in wxGTK wxDirDialog, fixes
#14525


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:26>

wxTrac

unread,
Oct 26, 2012, 8:47:44 PM10/26/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:27>

#14525: wxDirDialog::GetPath() doesn't return the user-selected path
-----------------------------+----------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: portneeded
Priority: high | Milestone: 2.8.13
Component: wxGTK | Version: 2.9.3
Resolution: port to stable | Keywords:
Blockedby: | Patch: 0
Blocking: |
-----------------------------+----------------------------------------------
Changes (by vadz):

* priority: normal => high
* status: closed => portneeded
* resolution: fixed => port to stable


Comment:

This needs to be redone to avoid breaking ABI, new members can't be added
to the stable branch.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:27>

wxTrac

unread,
Oct 27, 2012, 1:51:24 AM10/27/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:28>

#14525: wxDirDialog::GetPath() doesn't return the user-selected path
---------------------------+------------------------------------------------
Reporter: MichaelClerx | Owner:
Type: defect | Status: closed
Priority: high | Milestone: 2.8.13
Component: wxGTK | Version: 2.9.3
Resolution: fixed | Keywords:
Blockedby: | Patch: 0
Blocking: |
---------------------------+------------------------------------------------
Changes (by PC):

* status: portneeded => closed
* resolution: port to stable => fixed


Comment:

(In [72798]) redo r72781 in a way that preserves binary compatibility,
closes #14525


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14525#comment:28>
Reply all
Reply to author
Forward
0 new messages