Dialog versus Description
-
On 28/01/2013 at 11:51, xxxxxxxx wrote:
Still wondering about the difference between dialogs en descriptions.
I have a plugin tag with some UI.
When I try to Enable a UI field I get the message:
AttributeError: 'c4.Basecontainer' object has no attribute 'Enable'.I guess this is because I'm referring a description ('basecontainer') and not a dialog.
For other sort of plugins this is no problem.Here some code:
class ECHOS(plugins.TagData) :def Init(self, node) :
tag = node
data = tag.GetDataInstance()
data.SetLong(ECHOSMODE, ECHOSMANUAL)data.Enable(ECHOSstartframe, False) <== error
Is there another way to enable / disable UI fields?
-
On 28/01/2013 at 12:34, xxxxxxxx wrote:
For a description, things are a bit different. You don't call a function like Enable() to specifically enable/disable an element. In a description you have to implement the virtual function GetDEnabling().
For each element in the description which you want to have the facility to be enabled or disabled, you either return true to enable it, or false to disable it. Cinema calls this function and renders the element according to the returned value. There are certain to be examples in the python docs which show this working.