[Paraview] KWRange slider SetGroupRangeCallback

Sebastien BARRE sebastien.barre at kitware.com
Thu Dec 8 09:44:16 EST 2005


Hello Jean,

At 12/8/2005 09:27 AM, Jean M. Favre wrote:


>this->range->SetEndCommand(this, "SetGroupRangeCallback");
>
>void Example::SetGroupRangeCallback()
>{
>   double range[2];
>   this->range->GetRange(range);
>}
>
>I am aware that a lot has changed in the last few days with the
>KWWidgets. Is this a new problem?

Yes, definitely:

   // The 'object' argument is the object that will have the method called on
   // it. The 'method' argument is the name of the method to be called and any
   // arguments in string form. If the object is NULL, the method is still
   // evaluated as a simple command.
   // The following parameters are also passed to the command:
   // - the current (sub-)range: double, double
   virtual void SetCommand(vtkObject *object, const char *method);
   virtual void SetStartCommand(vtkObject *object, const char *method);
   virtual void SetEndCommand(vtkObject *object, const char *method);
   virtual void SetEntriesCommand(vtkObject *object, const char *method);

The vtkKWRange widget, as well as a couple other core widgets like 
vtkKWScale, vtkKWCheckButton, etc. now pass their current value to 
the callbacks. This makes it much easier to connect/chain them to 
other parts, reduce some dependencies (the receiving callback does 
not have to know about the UI element itself, or access it), and is 
more consistent with some other UI toolkits.

Sorry for the inconvenience. We are setting up a mailing list for 
KWWidgets where I will hopefully be able to announce that kind of changes.

Thanks

--
Sebastien Barre



More information about the ParaView mailing list