// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence: wxWidgets licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
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)