|
|
On 2/7/23 05:47, 'Mark' via
fltk.general wrote:
I need a widget that manages a collection of one or more
other widgets ("pages") just like a Tab widget does: but with no
tabs. The reason for no tabs is because this widget is tall and
narrow with about 8 "pages", so I want to provide navigation
using a combobox (i.e., a Choice widget) above it rather than
having tabs.
Derive a parent class from Fl_Group that's called "pages".
Inside that class
add your Fl_Choice widget (e.g. at the top), and below that, for
the rest of the space,
create another Fl_Group child called 'pages' that will contain
all the page content.
If the pages are literally text, you can probably get away with
just making that
'pages' group a single instance of Fl_Text_Display, and when the
Fl_Choice is changed,
just set the display's text content to the apropriate page
content.
Or, if the pages each have different widgets in them, make each
page a separate
Fl_Group (or a class derived from Fl_Group) that contains the
widgets of each page.
Set the position of all those groups in the SAME position, and
hide() all the ones except
the one to be shown using show(). And whenever Fl_Choice is
changed, just hide() all
the children except the one to be shown, and call
pages->redraw() to update the screen.
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/639e9f9a-2387-d525-e424-bc53e3ad3b26%40seriss.com.
[ Direct Link to Message ] | |
|
| |