[OpendTect_Developers] New popup menu insertion

Raman Singh raman.singh at dgbes.com
Mon Jun 17 10:58:29 CEST 2013


Hi Tracy,

> uiMenuItem* itm = mnumgr.procMnu()->find( "My New Menu" );

So far, so good. Now instead of casting 'itm' as uiPopupMenu*, cast it 
as uiPopupItem* and then call the function uiPopupItem::menu() to get 
the corresponding uiPopupMenu& where you can insert your new menu items.

Something like:

uiMenuItem* itm = mnumgr.procMnu()->find( "My New Menu" );
mDynamicCastGet(uiPopupItem*, popupitm, itm);
if ( popupitm )
      popupitm->menu().insertItem( <yournewmenuitem> );



I hope this helps.

Cheers,
Raman


On 06/15/2013 10:40 PM, Tracy Stark wrote:
> Hello,
>
> I have a plugin that creates a uiPopupMenu in the Processing pulldown menu
> using:
>          mnumgr.procMnu()->insertItem( mnu );
> Where mnu is a uiPopupMenu* that contains a single menu item.
>
> I am trying to create a second plugin that places another menu item into the
> uiPopupMenu of the previous plugin, if the uiPopupMenu exists.  I am able to
> determine whether or not the menu exists, but I can't figure out how to add
> another menu item.
>
> What I am trying to do would be similar to adding the "Tut Tools" menus to
> "Processing" -> "Create Seismic Output" instead of "Utilities" -> "Tools".
>
> I am able to use
>      uiMenuItem* itm = mnumgr.procMnu()->find( "My New Menu" );
>
> To return itm that is not null.  I have tried to use
>
> mDynamicCastGet(uiPopupMenu*, mnu2, itm)
>
>   but mnu2 returns as a null pointer.
>
> Any suggestions?  Is what I am trying to do even possible?
>
> Thanks,
>
> Tracy
>   
>
> Tracy J. Stark
> STARK Research / Stark Reality, Inc.
> 5021 Sparrows Point Drive
> Plano, TX   75023
> (972) 964-9796
> tstark3 at verizon.net


-- 
- Raman K Singh
- Manager - Software Development
-
- dGB Earth Sciences
- 304, Gateway Plaza, Hiranandani Gardens, Powai, Mumbai 400 076, India
- Phone: +91 22 25704984 , Fax: +91 22 25704977, Mobile: +91 9833452542
- mailto:raman.singh at dgbes.com, http://www.dgbes.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opendtect.org/pipermail/developers/attachments/20130617/76585d92/attachment.html>


More information about the Developers mailing list