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.

> 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.

>> 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}) ?

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

Reply via email to