Skip to content

Commit

Permalink
Instrument Window starts out hidden when created from python.
Browse files Browse the repository at this point in the history
Unfortunately it flickers up briefly if the instrument window is docked
(not the default), but I couldn't navigate my way through the floating
windows minefield to stop that happening.
Re #3784.
  • Loading branch information
RussellTaylor committed Jan 17, 2012
1 parent ac3f422 commit 6687128
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1776,9 +1776,11 @@ void MantidUI::manageMantidWorkspaces()
#endif
}

/**
* Create an instrument window from a named workspace or simply return the window if
* it already exists
/** Create an instrument window from a named workspace.
* The window will be returned hidden.
* @param wsName The name of the workspace for which to generate the instrument view.
* @param tab The index of the tab (starting from 0) to initially display (default: 0)
* @return A pointer to the instrument window widget if created. NULL otherwise.
*/
InstrumentWindow* MantidUI::getInstrumentView(const QString & wsName, int tab)
{
Expand Down Expand Up @@ -1816,6 +1818,8 @@ InstrumentWindow* MantidUI::getInstrumentView(const QString & wsName, int tab)
insWin->selectTab(tab);

appWindow()->addMdiSubWindow(insWin);
// When called from python, we want the window to start out hidden.
insWin->hide();

connect(insWin,SIGNAL(plotSpectra(const QString&,const std::set<int>&)),this,
SLOT(plotSpectraList(const QString&,const std::set<int>&)));
Expand Down

0 comments on commit 6687128

Please sign in to comment.