Avoid some GTK+ run-time errors when using wx{File,Dir}PickerCtrl

The wxGTK implementation uses wx{File,Dir}Button, which derives from
wxButton, but is not a GtkButton, so many operations which try to modify
it, such as changing it's style, are likely to result in errors.
See #17984
This commit is contained in:
Paul Cornett
2017-11-03 11:45:50 -07:00
parent 84b2ba40ee
commit d57d9ffaf7
2 changed files with 10 additions and 0 deletions

View File

@@ -101,6 +101,8 @@ public: // overrides
protected:
wxDialog *m_dialog;
virtual void DoApplyWidgetStyle(GtkRcStyle*) wxOVERRIDE;
private:
// common part of all ctors
void Init() { m_dialog = NULL; }
@@ -170,6 +172,8 @@ public: // overrides
protected:
wxDialog *m_dialog;
virtual void DoApplyWidgetStyle(GtkRcStyle*) wxOVERRIDE;
public: // used by the GTK callback only
bool m_bIgnoreNextChange;

View File

@@ -158,6 +158,9 @@ void wxFileButton::SetInitialDirectory(const wxString& dir)
wxGenericFileButton::SetInitialDirectory(dir);
}
void wxFileButton::DoApplyWidgetStyle(GtkRcStyle*)
{
}
#endif // wxUSE_FILEPICKERCTRL
#if wxUSE_DIRPICKERCTRL
@@ -331,4 +334,7 @@ void wxDirButton::SetInitialDirectory(const wxString& dir)
wxGenericDirButton::SetInitialDirectory(dir);
}
void wxDirButton::DoApplyWidgetStyle(GtkRcStyle*)
{
}
#endif // wxUSE_DIRPICKERCTRL