[OpendTect_Developers] New popup menu insertion
Tracy Stark
tstark3 at verizon.net
Mon Jun 17 18:38:28 CEST 2013
Raman,
Much thanks! This works beautifully!
Tracy
On 6/17/13 3:58 AM, "Raman Singh" <raman.singh at dgbes.com> wrote:
>
> 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
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opendtect.org/pipermail/developers/attachments/20130617/549fca7f/attachment.html>
More information about the Developers
mailing list