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:
@@ -95,7 +95,6 @@ public:
|
||||
|
||||
// Overridden wxWindow methods
|
||||
virtual void SetWindowStyleFlag( long style ) wxOVERRIDE;
|
||||
virtual bool Enable( bool enable = true ) wxOVERRIDE;
|
||||
|
||||
// Implementation from now on
|
||||
void OnDropFiles( wxDropFilesEvent &event );
|
||||
@@ -178,6 +177,8 @@ protected:
|
||||
private:
|
||||
void Init();
|
||||
|
||||
virtual void DoEnable(bool enable) wxOVERRIDE;
|
||||
|
||||
// overridden wxTextEntry virtual methods
|
||||
virtual GtkEditable *GetEditable() const wxOVERRIDE;
|
||||
virtual GtkEntry *GetEntry() const wxOVERRIDE;
|
||||
|
Reference in New Issue
Block a user