Hey all,
I've been playing around with tree views and ran into something I don't really understand. Would appreciate some help getting my head around it.
When a GADGETACTION Event is called from a treeview, the EventData() is the treeViewNode that the user clicked on. I worked this out looking through the source of the MaxIDE.
What I don't understand is how EventData() is being converted to a Gadget.
Passing EventData() through a Function argument will convert it. eg
I would have thought you could somehow simply typecast the EventData() something like this..
Can any of you programmers out there explain why passing it through a function works and perhaps suggest a cleaner method of converting the EventData to a Gadget.
Any help much appreciated.
I've been playing around with tree views and ran into something I don't really understand. Would appreciate some help getting my head around it.
When a GADGETACTION Event is called from a treeview, the EventData() is the treeViewNode that the user clicked on. I worked this out looking through the source of the MaxIDE.
What I don't understand is how EventData() is being converted to a Gadget.
Passing EventData() through a Function argument will convert it. eg
Function Convert:tGagdet (data:tGadget) Return data End Function Local thing:tGadget = Convert(EventData()) Notify thing.text 'etc
I would have thought you could somehow simply typecast the EventData() something like this..
local thing:tGadget = tGadget(EventData())
Can any of you programmers out there explain why passing it through a function works and perhaps suggest a cleaner method of converting the EventData to a Gadget.
Any help much appreciated.