diff --git a/pcbnew/toolbars_update_user_interface.cpp b/pcbnew/toolbars_update_user_interface.cpp index 8b59ac70c0..e6183e5498 100644 --- a/pcbnew/toolbars_update_user_interface.cpp +++ b/pcbnew/toolbars_update_user_interface.cpp @@ -109,7 +109,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 ); }