FbUiSelectionHolder
This is typically used to update the selection used by the default UI artwork panel or any other panel that makes use of the preferences under File > Preferences > Display > Selection viewers. Use in conjunction with the on_focus callback.
Examples
<caption>For playlist viewers</caption>
let selection_holder = fb.AcquireUiSelectionHolder();
selection_holder.SetPlaylistSelectionTracking();
function on_focus(is_focused) {
if (is_focused) { // Updates the selection when panel regains focus
selection_holder.SetPlaylistSelectionTracking();
}
}<caption>For library viewers</caption>
let selection_holder = fb.AcquireUiSelectionHolder();
let handle_list = null;
function on_mouse_lbtn_up(x, y) { // Presumably going to select something here...
handle_list = ...;
selection_holder.SetSelection(handle_list);
}
function on_focus(is_focused) {
if (is_focused) { // Updates the selection when panel regains focus
if (handle_list && handle_list.Count)
selection_holder.SetSelection(handle_list);
}
}