Brian wrote:
>> Hi,
>>
>> I'm using FLTK Tabs.
>> Is there a routine that will select a specific tab and force it to be
>> displayed and active?
>>
>> I've tried calling show() on the group associated with the specific
>> tab, but it does nothing:
>>
>
> I think all you need to do is hide() the other tabs
> http://www.fltk.org/documentation.php/doc-1.1/Fl_Tabs.html
Actually, that quote from the docs regarding hide()
describes how tabs works internally; clicking the tabs
does the hide()'s for you.
But that's not something you need to do yourself.
The correct way to flip between different tabs is
with the value() method, eg: tabs->value(somegroup);
The tabs widget will handle show()ing the correct group
and hide()ing all the others.
Example; see "<--" below:
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Tabs.H>
#include <FL/Fl_Group.H>
int main(int argc, char ** argv)
{
Fl_Window *win = new Fl_Window(400, 175);
Fl_Tabs *tabs = new Fl_Tabs(10, 10, 380, 150);
Fl_Group *tab1 = new Fl_Group(20, 30, 360, 125, "Tab1");
new Fl_Button(50, 40, 100, 25,"Button 1");
tab1->end();
Fl_Group *tab2 = new Fl_Group(20, 30, 360, 125, "Tab2");
new Fl_Button(50, 40, 100, 25,"Button 2");
tab2->end();
tabs->value(tab2); // <-- MAKE TAB2 VISIBLE
win->end();
win->show(argc, argv);
return(Fl::run());
}
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk