[Paraview-developers] Callback not being called when deselecting an item in the GUI of a plugin
Cory Quammen
cory.quammen at kitware.com
Thu Jan 8 13:47:24 EST 2015
Daniel,
The signature for SetAttributeEnabled() should be
void SetAttributeEnabled(const char * name, int status)
The status argument tells whether the attribute is enabled or not.
Also, your XML should be
<StringVectorProperty command="SetAttributeEnabled"
element_types="2 0"
label="Enabled attributes"
name="CellArrayStatus"
number_of_elements="0"
number_of_elements_per_command="2"
repeat_command="1">
<ArrayListDomain name="array_list">
<RequiredProperties>
<Property name="Input" function="Input" />
</RequiredProperties>
</ArrayListDomain>
</StringVectorProperty>
The element_types indicate the type of argument (2 for char string, 0 for int).
Please see ParaView/ParaViewCore/ServerManager/SMApplication/Resources/readers.xml
lines 241 - 262 for more hints that might help you.
Hope that helps,
Cory
On Thu, Jan 8, 2015 at 1:05 PM, Daniel Wilches Maradey
<dwilches at gmail.com> wrote:
> Hello,
>
> I'm creating a plugin that shows a list of the avaiable inputs, and
> allows the user to select which inputs should be processed. The
> following is the part of my XML that generates the list of inputs,
> each with a checkbox that allows me to select several of them:
>
> <StringVectorProperty command="SetAttributeEnabled"
> label="Enabled attributes"
> name="CellArrayStatus"
> number_of_elements="1"
> repeat_command="1">
> <ArrayListDomain name="array_list">
> <RequiredProperties>
> <Property name="Input" function="Input" />
> </RequiredProperties>
> </ArrayListDomain>
> </StringVectorProperty>
>
> The problem I'm facing is that the callback "SetAttributeEnabled" is
> only being called when I select an item, but not when I deselect it,
> so I cannot know the actual state of the checkboxes in this way.
>
> Do you know how to force the callback to be called when deselecting an
> item? or how can I retrieve an array of all selected items from my C++
> plugin?
>
> If needed, this is my C++ callback:
>
> public:
> void SetAttributeEnabled(char* name);
>
>
> Thanks.
> _______________________________________________
> Paraview-developers mailing list
> Paraview-developers at paraview.org
> http://public.kitware.com/mailman/listinfo/paraview-developers
--
Cory Quammen
R&D Engineer
Kitware, Inc.
More information about the Paraview-developers
mailing list