> Gary Hui Zhang wrote:
>
> > I figure that a natural way of remedying this is to add a callback to each 
> > tab to execute the hide() explicitly.
>
> That shouldn't be necessary. The Fl_Tabs widget does exactly that when
> you select a tab: it show()s its group and hides any other contained groups.

This was my understanding but it doesn't appear to work, at least on MacOSX.

> > But it appears that the callback inserted never gets called.  Here is the 
> > actual code:
> >
> >       Fl_Tabs m_LayerUITabs {open
> >         xywh {180 5 390 475} box PLASTIC_THIN_UP_BOX color 41
> >       } {
> >         Fl_Group m_ImageContrastTab {
> >           label Contrast open selected
> >           callback {this->DisplayImageContrastTab();}
> >           xywh {180 25 390 455} labelsize 12
> >         } { .... }
> >
> > Note the callback for the tab (Fl_Group m_ImageContrastTab).  That function 
> > does not get called when I select the tab ...
> >
> > Is this the correct behavior?
>
> If you want a callback to be called when you change the tabs, then you
> must set it for the Fl_Tabs widget. Its value() is the currently
> selected group.

Thanks very much for the correction.  I added the callback for Fl_tabs and use 
value() to conditionally call different hide() functions.  Everything now works 
nicely.

> >> I don't know if this is a GL specific problem (may be), but problems
> >> like this one often have a common cause that the groups that are
> >> contained in the tabs don't fill the tab group area completely (except
> >> the tab area itself). Please check, if this could be the case in your
> >> program.
> >
> > Do you think the code above suffering from the problem you described?
>
> The Fl_Tabs and the contained group look okay for me (but I can't really
> "read" and understand fluid code well, because I never use it). However,
> the important part is missing: Is your GL window within the limits of
> its containing group (in this case: xywh {180 25 390 455}) ?

It looks like things are within the bound.  Here are the two GL drawing areas 
on two different tabs.

            Fl_Box m_BoxCurve {
              label {Curve Display Area}
              xywh {210 135 340 180} box BORDER_BOX color 246 labelfont 1 
labelsize 12 align 16
              code0 {\#include "IntensityCurveBox.h"}
              class IntensityCurveBox
            }

            Fl_Box m_BoxColorMap {
              label {OpenGL Colormap Display}
              xywh {200 143 350 69} box BORDER_BOX color 246 labelfont 1 
labelsize 12
              code0 {\#include "ColorMapWidget.h"}
              class ColorMapWidget
            }

Gary
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to