How to get a pointer for mainwindow?

dukju ahn dukjuahn at gmail.com
Mon Mar 12 11:15:34 UTC 2007


2007/3/12, Andreas Pakulat <apaku at gmx.de>:
> On 12.03.07 00:55:47, dukju ahn wrote:
> > >From my plugin, I want to append popup menu in mainwindow
> > ie.
> >
> > connect( Core::mainWindow(),
> >              SIGNAL(contextMenu(KMenu *, const Context *)),
> >              this,
> >              SLOT(contextMenu(KMenu *, const Context *)));
> >
> > void KDevSubversionPart::contextMenu
> >         (KMenu *menu, const KDevelop::Context *ctx)
> > { menu->add.. }
> >
> > This is from kdevcontext.h documentation. However, Core::mainWindow()
> > does not actually exist. I cannot find any other way to retrieve
> > mainwindow pointer.
> >
> > Plugins can have access to ICore, and through ICore, IUiController
> > can be accessed. But activeMainWindow() or defaultMainWindow()
> > only exist in UiController, which the plugins does not have access.z
>
> They do have access to ICore, see the IPlugin API.
>

I know. ICore and IUiController are accessable from plugin.
But UiController ITSELF cannot be accessed.

And any methods that can return MainWindow is in UiController, not the
I_Uicontroller interfaces.

In short, plugins can have access only to INTERFACES, but the
interfaces do not provide (or I cannot find) any methods to MainWindow, which
emits contextMenu signal.

I think I could make mistake or overlook something. Can you be more detail?
Thanks.




More information about the KDevelop-devel mailing list