CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 01-14-2013, 04:22 AM   #1
sumchans
Know-it-All
portfolio
Sumesh Chandran
Toronto, Canada
 
Join Date: Jan 2011
Posts: 422
How to add click events to dynamic context menus?

Hi all,

Here is the line that triggers the event on a context menu item click. The items are generated dynamically when the user clicks the button. How do I get the name of the item that is clicked?

Code:
fn cmCamViewsItemClick arg= ( " I want to get the name of the item clicked over here" ) for i = 0 to cmCamViews.MenuItems.count-1 do ( dotNet.addEventHandler cmCamViews.MenuItems.item[i] "click" cmCamViewsItemClick )


Here cmCamViews is the contextmenu.

I am just totally confused checking the MSDN library and cgtalk posts.
Still on the same project which is on the viewport configuration, trying out multiple ways, got stuck two times prior to this trial and I fell this approach would be much better than I initially thought about it.

Please help
__________________
Thanks all.
 
Old 01-14-2013, 08:11 AM   #2
lo
the frequentest!
portfolio
Rotem Shiffman
Tel Aviv, Israel
 
Join Date: Jul 2005
Posts: 2,859
Code:
fn cmCamViewsItemClick sender arg= ( --sender is your menu item. sender.name --is it name? I can't remember? maybe .text? )
 
Old 01-14-2013, 02:32 PM   #3
sumchans
Know-it-All
portfolio
Sumesh Chandran
Toronto, Canada
 
Join Date: Jan 2011
Posts: 422
Thanks Lo,

It was sender.text

Such an easy thing..

Thanks anyway
__________________
Thanks all.
 
Old 01-14-2013, 02:32 PM   #4
CGTalk Moderation
Expert
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,478
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 01:34 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.