Problem with listbox eventhandler call
by Philipp Leibelt on May 13, 2009 at 12:18:12 pm
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.
Re: Problem with listbox eventhandler call by Alejandro Martinez on Oct 28, 2015 at 12:55:21 am
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.