ataylor Posted March 9, 2015 Posted March 9, 2015 I have a Listbox with a callback attached to the GUI_CHANGED event. Clicking to change the selection results in the callback function being called as expected. I also have functionality to remove the currently selected item from the Listbox, which of course causes the selection to change. I would expect indirectly changing the selection in this manner to result in the GUI_CHANGED callback being fired, but this is not the case. I must call my callback manually.
unclebob Posted March 10, 2015 Posted March 10, 2015 Hello, Adam! WidgetListBox will fire CHANGED callback only when its selection changes, not the contents. So in your case consider firing custom callback manually.
ataylor Posted March 11, 2015 Author Posted March 11, 2015 I may not have been clear. I wouldn't expect a callback to be fired simply when the contents change. However, in the case where you delete the same item as the one currently selected, that results in the listbox having a new selection after the delete finishes. The selection has changed, but the GUI_CHANGED callback is not fired. e.g. if you have "foo", "bar" and "qux" in a listbox, clicking and selecting "bar" will fire the GUI_CHANGED callback. Calling removeItem(1) while "bar" is still selected will remove "bar" from the listbox and cause "foo" to be the newly selected item. I would expect the GUI_CHANGED callback to be fired here as a selection change has occured, but it does not.
unclebob Posted March 12, 2015 Posted March 12, 2015 Thanks for clarification! Now that makes much more sense and indeed callback is not firing. Passed that to devs, not ETA on that unfortunately.
ataylor Posted March 12, 2015 Author Posted March 12, 2015 Okay, thank you. Easy to work around in the meantime.
Recommended Posts