[Insight-developers] FLTK Light Button & ProgressBar Observers

Luis Ibanez luis.ibanez@kitware.com
Fri, 12 Apr 2002 22:47:14 -0400


Hi

Some polishing has been made on the FLTK derived widgets:

    fltkLightButton
    fltkProgressBar

both available at:    Insight/Auxiliary/FltkImageViewer

fltkLightButton derives from Fl_Light_Button  and has a builtin
itk::Command ( a ReceptorMemberCommand to be precise).
This button can be set with "fluid" on an FLTK GUI and then
be connected to "Observe" any itkProcessObject.  The use
is like:


#include <fltkLightButton.h>
fltk::LightButton  * myButton =
                      new fltk::LightButton(100,300,15,25,"Filter A");
FilterType::Pointer  myFilter = FilterType::New();
myButton->Observe(  myFilter.GetPointer() );


The button is set to change its colors according to some events
from the Filter (the ProcessObject in general). The colors
associations are:

ModifiedEvent  -> Red
StartEvent -> Yellow
EndEvent -> Green

--

In a similar way, fltkProgressBar derives from Fl_Slider.
It also has a ReceptorMemberCommand as ivar and can be
connected to any itk::ProcessObject as:

#include <fltkProgressBar.h>
fltk::ProgressBar  * myProgressBar =
            new fltk::ProgressBar(100,300,15,250,"Filter A");
FilterType::Pointer  myFilter = FilterType::New();
myProgressBar->Observe(  myFilter.GetPointer() );

The progress bar only responds to the ProgressEvent
and take the values from 0 to 1 of progress to fill in
the slider on the GUI.

--

Examples of the use of these FTLK widgets can
be seen in:

     Examples/GaussianFilter
     Examples/Curve2DExtractor
     Examples/ImageRegistration




Luis