PDA

View Full Version : Dynamic Event Handlers


RustyKnight
11-01-2007, 12:18 AM
I'm curious if any one knows a way to dynamically register event handlers in maxscript.

I've written a bunch of code for a dotnet listview control that maintains the visual selection after the user leaves the control (hacked is a better word), but I would really like to attach this code dynamically to any listview control I create in the future, rather then having to copy-paste the event handlers each time.

Any ideas?
Shane

JHN
11-01-2007, 08:32 AM
I'm not quite sure, but I think the only way will be to create strings with the dynamic code and execute them... just like the lightlister... Maybe dotnet gives you the ability to do it dynamicly, but someone else should answer that one.

If it's gonna be strings, than take a look at the RolloutCreator Functions in the mxs help and "stdplugs\stdscripts\baseLib\rolloutCreator.ms". You could maybe build your own struct/functions as baselib to quickly create rollouts and (dotnet) controls.

-Johan

RustyKnight
11-01-2007, 08:43 PM
I'm not quite sure, but I think the only way will be to create strings with the dynamic code and execute them... just like the lightlister... Maybe dotnet gives you the ability to do it dynamicly, but someone else should answer that one.

If it's gonna be strings, than take a look at the RolloutCreator Functions in the mxs help and "stdplugs\stdscripts\baseLib\rolloutCreator.ms". You could maybe build your own struct/functions as baselib to quickly create rollouts and (dotnet) controls.

-JohanThat is a really good idea! I can't believe I didn't think of it, after all the time I've spent building dynamic rollouts!!

Thanks for the "nudge" in the right direction!

Cheers
Shane

JHN
11-02-2007, 01:18 PM
Glad my brilliant insights :rolleyes: helped you. :)

-Johan

CGTalk Moderation
11-02-2007, 01:18 PM
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.