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:
@@ -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;
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user