Override DoEnable() instead of Enable() in wxGTK controls
This is slightly simpler, as it doesn't require checking whether the control state really changes or not (it always does if DoEnable() is called) and allows disabling the controls before creating them, e.g. code like wxButton* const b = new wxButton(); b->Disable(); b->Create(this, wxID_OK); works as expected now instead of spewing GTK+ errors.
This commit is contained in:
@@ -23,8 +23,6 @@ public:
|
||||
m_isPressed = false;
|
||||
}
|
||||
|
||||
virtual bool Enable( bool enable = true ) wxOVERRIDE;
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
@@ -41,6 +39,8 @@ public:
|
||||
protected:
|
||||
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const wxOVERRIDE;
|
||||
|
||||
virtual void DoEnable(bool enable) wxOVERRIDE;
|
||||
|
||||
virtual wxBitmap DoGetBitmap(State which) const wxOVERRIDE;
|
||||
virtual void DoSetBitmap(const wxBitmap& bitmap, State which) wxOVERRIDE;
|
||||
virtual void DoSetBitmapPosition(wxDirection dir) wxOVERRIDE;
|
||||
|
Reference in New Issue
Block a user