X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/14f355c2b5c71fc7c3d680aea366582d2ac60f7b..a83ea9c15a7ac7bbdc6686164cfcbbc21ae5031a:/src/motif/toolbar.cpp?ds=sidebyside diff --git a/src/motif/toolbar.cpp b/src/motif/toolbar.cpp index 4078d2eefe..54a6419baa 100644 --- a/src/motif/toolbar.cpp +++ b/src/motif/toolbar.cpp @@ -21,6 +21,9 @@ #pragma implementation "toolbar.h" #endif +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + #ifdef __VMS #define XtDisplay XTDISPLAY #endif @@ -589,8 +592,12 @@ bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool) void wxToolBar::DoEnableTool(wxToolBarToolBase *toolBase, bool enable) { wxToolBarTool *tool = (wxToolBarTool *)toolBase; - - XtSetSensitive(tool->GetButtonWidget(), (Boolean) enable); + if (tool->GetButtonWidget()){ + XtSetSensitive(tool->GetButtonWidget(), (Boolean) enable); + } else if (wxTOOL_STYLE_CONTROL == tool->GetStyle()){ + // Controls (such as wxChoice) do not have button widgets + tool->GetControl()->Enable(enable); + } } void wxToolBar::DoToggleTool(wxToolBarToolBase *toolBase, bool toggle)