In wxWidgets 3.3 under GTK it is only possible to show the built-in prefernce dialog once: after it is created only the first call to wxPreferencesEditor::Show() would display the dialog, any subsequent calls do nothing. This is a regression comparing to wxWidgets 3.2 brach where wxPreferencesEditor::Show() works as expected.
When implemented like in src/samples/preferences/preferences.cpp the following method
void MyApp::ShowPreferencesEditor(wxWindow* parent) { if ( !m_prefEditor ) { m_prefEditor.reset(new wxPreferencesEditor); m_prefEditor->AddPage(new PrefsPageGeneral()); m_prefEditor->AddPage(new PrefsPageTopics()); } m_prefEditor->Show(parent); }
should display preferences dialog on all platforms every time it is called.
Under GTK only first call to void MyApp::ShowPreferencesEditor(wxWindow* parent) actually displays the dialog.
preferences built in 1Debugging leads via wxModelessPreferencesEditorImpl::Show() (generic/preferencesg.cpp:175) to the most probable cause of the bug in wxTopLevelWindowGTK::Raise() (gtk/toplevel.cpp:1306):
if (!m_isShown) return;
Since the preference dialog (hence its top-level window) is hidden at that time, the line with gtk_window_present() doesn't get executed and dialog remains hidden.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
Possible (but ugly) workaround:
void MyApp::ShowPreferencesEditor(wxWindow* parent) { #if defined (__WXGTK__) && wxCHECK_VERSION(3,3,0) m_prefEditor.reset(nullptr); #endif
if ( !m_prefEditor )
{
m_prefEditor.reset(new wxPreferencesEditor);
m_prefEditor->AddPage(new PrefsPageGeneral());
m_prefEditor->AddPage(new PrefsPageTopics());
}
m_prefEditor->Show(parent);
}—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
I was about to file a PR but @paulcor was faster, kudos for that
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()