Adding a String List to the UI
I'm having trouble trying to add a TMFNameListPart into the User Interface to simply add a list of strings. I can get the list to appear and to add some strings into it, using a few attempted methods, but then this causes the plugin to become unstable and indirectly cause Nil Pointer errors. I haven't seen some full example code for this but there was a rough outline on the old SDK group.
I started in MCSketch by adding a TMFScrollPart (with attached sliders) then its child leaf part is a TMFNameListPart with a part ID 'myID'. Nothing was added to the resource or PMap for the plugin. If that is all I do I get an empty space for the list and the plugin works as normal.
Then in the plugin's ::HandleEvent(...) I add the following :
MCOMErr MyPlugin::HandleEvent(int32 message, IMFResponder* source, void *data)
// method 1 : create an TMCClassArray Names; elsewhere and add some strings
// method 2: use IMFPart to SetValue
TMCString nameString="item 1";
When this code is used the string list is filled with the names, they can be selected, but Nil Pointer errors start up elsewhere in the plugin's operations.
Should I be using TMFStringDataPacket here, and if so, how ? What is the correct way to add (and manage) a selectable list of strings into the UI ?