On 03/14/2014 05:41 PM, Federico Milano wrote:
> Hi. Maybe the subject of this mail seems an oximoron, but I have a 
> View that just uses the render windows to interact with the user; I've 
> no controls to put into the View. I just use its mechanism to 
> activate/deactivate the interactor I use in the render windows. Is it 
> possible to make it invisible and to control the 
> Activation/Deactivation in another way that does not imply a view window?
>
> Thanks in advance,
>
> Federico

Hi,

I assume you are using something like IRenderWindowPartListener in your 
View implementation?

You could implement berry::IPartListener [1] without any UI 
contributions and register your implementation in you plug-ins activator 
using

berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetPartService()->AddPartListener(<your-listener>);

You would probably also want your plug-in to be "eagerly started" [2] 
such that your activator is called at workbench start-up and you 
listener is registered.

In general, in the call chain above results could be NULL. For a robust 
solution you should implement berry::IWindowListener [3] and register / 
unregister your part listener in the WindowActivated() and 
WindowDeactivated() callback respectively. Something similar is done in 
QmitkFunctionalityCoordinator.cpp [4].

Best,
Sascha


[1] http://docs.mitk.org/nightly-qt4/structberry_1_1IPartListener.html
[2] 
https://github.com/MITK/MITK/blob/master/Plugins/org.mitk.planarfigure/manifest_headers.cmake#L6
[3] http://docs.mitk.org/nightly-qt4/structberry_1_1IWindowListener.html
[4] 
https://github.com/MITK/MITK/blob/master/Plugins/org.mitk.gui.qt.common.legacy/src/QmitkFunctionalityCoordinator.cpp#L32

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to