MotionBuilder python; dynamically populating a FBTabControl

I’m trying to do a UI that connects to some stuff in the scene and adds tabs to the UI based on the contents in the scene.

I’ve already got this working for a DropDownList, but my animators would prefer it to be presented as tabs instead.

I figured this would be simple, but I can’t manage to find how to delete Tabs from the FBTabControl.

So to elaborate on the use-case I’m trying to achieve:

  1. Animator has UI and scene open
  2. Scene contains 2 of item type X
  3. UI displays one tab per X, with some actions related to the scene-object contained in the tab.
  4. Animator deletes one of the X from the scene
  5. UI updates (through refresh button or callback) and displays only one tab.

Anyone have any ideas?

Yeah I just found it.

tab.TabPanel.Items.removeAll()
del tab.TabContents[:]