Novice needs help with wxFileDialog in X11
Novice needs help with wxFileDialog in X11
I am new to wxWidgets.
wxWidgets 3.0.3 with native X11 bindings is installed. wxFileDialog displays empty panels. Screenshot:
http://www.geocities.jp/hitotsubishi/sc ... roblem.png
What am I doing wrong?
m_fileDialog = new wxFileDialog(this, _("Select Source File"), _("/"), wxEmptyString, _("*|*"), (wxFD_OPEN | wxFD_FILE_MUST_EXIST));
if (m_fileDialog->ShowModal() == wxID_CANCEL) {
//
};
m_fileDialog->Destroy();
delete m_fileDialog;
wxWidgets 3.0.3 with native X11 bindings is installed. wxFileDialog displays empty panels. Screenshot:
http://www.geocities.jp/hitotsubishi/sc ... roblem.png
What am I doing wrong?
m_fileDialog = new wxFileDialog(this, _("Select Source File"), _("/"), wxEmptyString, _("*|*"), (wxFD_OPEN | wxFD_FILE_MUST_EXIST));
if (m_fileDialog->ShowModal() == wxID_CANCEL) {
//
};
m_fileDialog->Destroy();
delete m_fileDialog;
Re: Novice needs help with wxFileDialog in X11
First of all, the X11 port of wxWidgets is hardly used any more and is not so well maintained as the ports for the three major platforms. So you should only use it if GTK is not available on the target machine.
Can you build and run any of the wxWidgets samples that use a wxFileDialog, e.g. the "dialogs" sample?
Can you build and run any of the wxWidgets samples that use a wxFileDialog, e.g. the "dialogs" sample?
Use the source, Luke!
Re: Novice needs help with wxFileDialog in X11
Hi,
Judging from the screenshot you are not running plain X server, but rather (I think) KDE. Which means that the toolkits like gtk/qt are available.
So, what you should do is to install the gtk+ from the repository (either gtk+2 or gtk+3 - whatever is available), install gtk development package (in order to have the headers installed) and then recompile wxWidgets with the following options:
Thank you.
Judging from the screenshot you are not running plain X server, but rather (I think) KDE. Which means that the toolkits like gtk/qt are available.
So, what you should do is to install the gtk+ from the repository (either gtk+2 or gtk+3 - whatever is available), install gtk development package (in order to have the headers installed) and then recompile wxWidgets with the following options:
Code: Select all
../configure --enable-debug --enable-debug_gdb --with--gtk
Re: Novice needs help with wxFileDialog in X11
One reason for not building against gtk is that the executable has to run on machines that might not have gtk. The licence for gtk is not as free as for wxwidgets. In fact I did install gtk development tools but after seeing gtk's licence I configured wxWidgets for plain X11.
However, yes I could build the samples. Some work better than others. Fairly recently someone patched the widgets sample to add a setting to the slider constructor so the slider doesn't crash, and I made a similar patch to the slider constructor in the controls sample. I didn't see a sample filedialog.
However, yes I could build the samples. Some work better than others. Fairly recently someone patched the widgets sample to add a setting to the slider constructor so the slider doesn't crash, and I made a similar patch to the slider constructor in the controls sample. I didn't see a sample filedialog.
Re: Novice needs help with wxFileDialog in X11
Hi,
The sample you need to build is called "dialogs".
But more general, if you decide to go with X11, you are on your own. This port is rarely receive any attention from the wx core team as nobody cares about it too much. It is in a buildable state and most samples can be build and some can be run. But the overall condition of the port is - it is very seriously outdated.
The only reason it is kept in the tree is for people who want to create a new port as a starting point.
So if you want to become an official maintainer of the X11 port - send an E-mail to wx-dev and ask for that possibility.
Also, keep in mind - we are not talking about GNOME here, just the GTK+. Which I believe can be installed even on Raspberry PI as well as other mini-computers.
Thank you.
The sample you need to build is called "dialogs".
But more general, if you decide to go with X11, you are on your own. This port is rarely receive any attention from the wx core team as nobody cares about it too much. It is in a buildable state and most samples can be build and some can be run. But the overall condition of the port is - it is very seriously outdated.
The only reason it is kept in the tree is for people who want to create a new port as a starting point.
So if you want to become an official maintainer of the X11 port - send an E-mail to wx-dev and ask for that possibility.
Also, keep in mind - we are not talking about GNOME here, just the GTK+. Which I believe can be installed even on Raspberry PI as well as other mini-computers.
Thank you.
Re: Novice needs help with wxFileDialog in X11
I have no trouble believing that GTK+ will run on a Raspberry Pi, but the licence isn't as free as the wxWidgets licence.
[edit]
#if 0
I'll look at the dialogs sample.
#else
The dialogs sample crashes immediately.
X Error of failed request: BadWindow (invalid Window parameter)
If I could program raw X11 stuff, I might not have tried using wxWidgets.
#endif
[edit]
#if 0
I'll look at the dialogs sample.
#else
The dialogs sample crashes immediately.
X Error of failed request: BadWindow (invalid Window parameter)
If I could program raw X11 stuff, I might not have tried using wxWidgets.
#endif
Re: Novice needs help with wxFileDialog in X11
Although the dialogs sample doesn't execute, I could understand part of its source code. There's an undocumented class wxGenericFileDialog which I could try using in my project,
[editing this reply too]
#if 0
and it works in raw X11. I'm not sure if I'm going to read internals to learn the difference between wxFileDialog and wxGenericFileDialog, but I'll use the one that works.
#else
and it worked twice in raw X11, but then it stopped working. After the first two times, wxGenericFileDialog stopped working and looks like wxFileDialog.
#endif
[editing this reply too]
#if 0
and it works in raw X11. I'm not sure if I'm going to read internals to learn the difference between wxFileDialog and wxGenericFileDialog, but I'll use the one that works.
#else
and it worked twice in raw X11, but then it stopped working. After the first two times, wxGenericFileDialog stopped working and looks like wxFileDialog.
#endif
Re: Novice needs help with wxFileDialog in X11
Hi,
However the 'widgets' sample uses the similar wxFileCtrl successfully. You might like to substitute that.
AFAIK the only significant difference is that you can't distribute non-GPL programs that statically-link to it. And that's not something you should want to do anyway: it's simpler and safer to link dynamically to the gtk+ libs that come with that distro/version. Even if you were allowed to link statically, you couldn't rely on any particular build being binary-compatible with other distros or versions.
Regards,
David
Yes, I get that too in wxWidgets-3.1.1-rc. That sort of thing is one reason to avoid wxX11.The dialogs sample crashes immediately.
However the 'widgets' sample uses the similar wxFileCtrl successfully. You might like to substitute that.
Out of interest, what problem do you have with its licence?In fact I did install gtk development tools but after seeing gtk's licence...
AFAIK the only significant difference is that you can't distribute non-GPL programs that statically-link to it. And that's not something you should want to do anyway: it's simpler and safer to link dynamically to the gtk+ libs that come with that distro/version. Even if you were allowed to link statically, you couldn't rely on any particular build being binary-compatible with other distros or versions.
Regards,
David
Re: Novice needs help with wxFileDialog in X11
I didn't realize that dynamic linking had a more permissive licence. I'm still not sure if we can assume all end users will have GTK+.
Re: Novice needs help with wxFileDialog in X11
I'm not aware of any current gui distro that doesn't provide gtk+; certainly all the common ones do.I'm still not sure if we can assume all end users will have GTK+
Of course that doesn't guarantee that the particular user will have the libs actually installed, but that's why you distribute the app as a deb/rpm/whatever that depends on the correct gtk+ libs, rather than as a plain binary. Or I suppose nowadays, why you use a AppImage/Flatpak/Snap/...
Re: Novice needs help with wxFileDialog in X11
Hi,
And for the distro that do everything from sources you can write a simple script that will install all dependencies (like ebuild for Gentoo).
Thank you.
And for the distro that do everything from sources you can write a simple script that will install all dependencies (like ebuild for Gentoo).
Thank you.