That's not a good way to do it; you shouldn't put one widget
"over"
another unless it's a child.
It seems like you're trying to do is make a tab called "x" so
when it's clicked
it closes the parent window.
A good way to do that is to create a new tab group called "X",
just like the other tabs,
and set the
cb_tabs_group() callback to detect when
that tab is selected and close the
parent window by
hide()ing it. The result will look
the same:

..and the tab will look like the others, and will be keyboard
navicable.
See my suggested patch below for how that's done.
For what you proposed, as a general rule you shouldn't position
one widget "over" another. The only exception is if the widget is
defined as a child of a parent group. So that isn't really allowed.
Here's a patch to the tabs.cxx code that does what I
suggested:
---
/usr/local/src/fltk-1.4.x.git/build/test/tabs.cxx 2025-11-17
14:02:05.810111969 -0800
+++ tabs.cxx 2026-04-28 09:43:09.461697129 -0700
@@ -1,10 +1,11 @@
-// generated by Fast Light User Interface Designer (fluid)
version 1.0404
+// generated by Fast Light User Interface Designer (fluid)
version 1.0500
#include "tabs.h"
Fl_Double_Window *foo_window=(Fl_Double_Window *)0;
Fl_Tabs *tabs_group=(Fl_Tabs *)0;
+Fl_Group *x_grp = 0; // new global group for the "x" tab
button
static void cb_tabs_group(Fl_Tabs* o, void*) {
Fl_Widget *sel_tab = o->value();
@@ -13,6 +14,10 @@
} else {
printf("Callback called\n");
}
+ // Close the parent window if the x_grp was selected
+ if (sel_tab == x_grp) {
+ o->parent()->hide();
+ }
}
static void cb_Label(Fl_Group* o, void*) {
@@ -254,6 +259,10 @@
} // Fl_Window* o
o->end();
} // Fl_Group* o
+ { x_grp = new Fl_Group(10, 60, 315, 235, "X");
+ // Opening this group closes the parent window,
+ // so it will never be seen..
+ }
//
tabs_group->handle_overflow(Fl_Tabs::OVERFLOW_PULLDOWN);
tabs_group->end();
Fl_Group::current()->resizable(tabs_group);