diff --git a/pcbnew/toolbars_update_user_interface.cpp b/pcbnew/toolbars_update_user_interface.cpp index 51c8b7eabd..6161cbaa85 100644 --- a/pcbnew/toolbars_update_user_interface.cpp +++ b/pcbnew/toolbars_update_user_interface.cpp @@ -78,7 +78,10 @@ void PCB_EDIT_FRAME::OnUpdateLayerSelectBox( wxUpdateUIEvent& aEvent ) // Used only when the DKICAD_SCRIPTING_WXPYTHON option is on void PCB_EDIT_FRAME::OnUpdateScriptingConsoleState( wxUpdateUIEvent& aEvent ) { - wxMiniFrame * pythonPanelFrame = (wxMiniFrame *) findPythonConsole(); + if( aEvent.GetEventObject() != m_mainToolBar ) + return; + + wxMiniFrame* pythonPanelFrame = (wxMiniFrame *) findPythonConsole(); bool pythonPanelShown = pythonPanelFrame ? pythonPanelFrame->IsShown() : false; aEvent.Check( pythonPanelShown ); }