//=======================================================================
void GeometryGUI::OnGUIEvent( int id )
{
- SUIT_Desktop* desk = application()->desktop();
+ SUIT_Application* anApp = application();
+ if (!anApp) return;
+ SUIT_Desktop* desk = anApp->desktop();
// check type of the active viewframe
SUIT_ViewWindow* window = desk->activeWindow();
{
GUIMap::Iterator it;
bool bOk = true;
- for ( it = myGUIMap.begin(); it != myGUIMap.end(); ++it )
- bOk = bOk && it.data()->OnKeyPress( pe, application()->desktop(), win );
+ for ( it = myGUIMap.begin(); it != myGUIMap.end(); ++it ) {
+ SUIT_Application* anApp = application();
+ if (!anApp) return;
+ bOk = bOk && it.data()->OnKeyPress( pe, anApp->desktop(), win );
+ }
// return bOk;
}
{
GUIMap::Iterator it;
bool bOk = true;
- for ( it = myGUIMap.begin(); it != myGUIMap.end(); ++it )
- bOk = bOk && it.data()->OnMouseMove( pe, application()->desktop(), win );
+ for ( it = myGUIMap.begin(); it != myGUIMap.end(); ++it ) {
+ SUIT_Application* anApp = application();
+ if (!anApp) return;
+ bOk = bOk && it.data()->OnMouseMove( pe, anApp->desktop(), win );
+ }
// return bOk;
}
// OnMousePress() should return false if this event should be processed further
// (see OCCViewer_Viewer3d::onMousePress() for explanation)
bool processed = false;
- for ( it = myGUIMap.begin(); it != myGUIMap.end(); ++it )
- processed = processed || it.data()->OnMousePress( pe, application()->desktop(), win );
+ for ( it = myGUIMap.begin(); it != myGUIMap.end(); ++it ) {
+ SUIT_Application* anApp = application();
+ if (!anApp) return;
+ processed = processed || it.data()->OnMousePress( pe, anApp->desktop(), win );
+ }
// return processed;
}