I have a small problem with maxscript (2009) and I just dont know what is wrong :)
Eventhandlers of UI controls can be call by e.g.:
But if I want to call the "selected" eventhandler of a listbox by:
maxscript throws an error that it needs a function but gets a string of the selected item.
should return the items name... the other code should call the eventhandler.
Going to leave this non-elegant solution to this problem in the meantime:
- Create a function helper that you can call anytime you want, i.e. someListBox_selected item_idx function.
- if the actual someListBox.selected is called via mouse click inputs, just relay to your helper one.
-- Listbox event handling region:
fn someListBox_selected item_idx =
-- do something with item idx.
MessageBox ("Item selected on listbox: " + (item_idx as string))
on someListBox.selected item_idx do
-- Just relay
Reason for this years old post:
Was looking around for about an hour now for this exact same problem and this post appeared many times. If a better solution was found it would be nice to share it.