How to add click events to dynamic context menus?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 01 January 2013   #1
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?


 
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 January 2013   #2

fn cmCamViewsItemClick sender arg=
 (
   --sender is your menu item.
  sender.name --is it name? I can't remember? maybe .text?
 )
 
Old 01 January 2013   #3
Thanks Lo,

It was sender.text

Such an easy thing..

Thanks anyway
__________________
Thanks all.
 
Old 01 January 2013   #4
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.
 
Thread Closed share thread



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 04:59 AM.


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