On 10/30/20 8:00 PM Greg Ercolano wrote:
> On 2020-10-30 05:30,
holm.h...@gmail.com wrote:
>>
>> Hello,
>>
>> I need to hide() a group which is under a group.
>>
>> That functionality should be in the test/tabs program:
>> { Fl_Group* o = new Fl_Group(10, 60, 315, 235, "@fileprint &print");
>> o->tooltip("tab5 verifies if visibility requests are handled correctly");
>> o->hide();
>>
>> For me the tab do however show.
>>
>> any suggestions ?
>
>
> Since Fl_Tabs uses the hide() / show() flag on the immediate child groups
> to make them show when a tab is clicked, I don't think setting hide() on
> the tab child groups will be effective, as Fl_Tabs will override it depending
> on which tab is clicked.
Yep, that's the point I wanted to make as well. Setting hide() on all
included children is only an initialization.
I believe the OP would want to use the Fl_Tabs::value(Fl_Widget *)
method to establish the tab group being actively shown(), see:
https://www.fltk.org/doc-1.4/classFl__Tabs.html#a188bef71735c167e44af095ddd4922b6
"int Fl_Tabs::value(Fl_Widget *newvalue)
Sets the widget to become the current visible widget/tab.
Setting the value hides all other children, and makes this one visible,
if it is really a child."
The last part of the last sentence is important: the argument to
value(Fl_Widget *) must be one of the direct children (i.e. one of the
Fl_Groups) used in the Fl_Tabs widget.