I like and want to use tabs and created a superclass that works very well. Tab bar shows/hides while maintaining proper control alignment, I can add or remove via the tab bar as well as the “Show all Tabs” (tab overview) menu option functions as well. All good.
I used setAllowsAutomaticWindowTabbing to enable the system. Taking inspiration from others in the forum I used addTabbedWindow to add windows to the tab group. Poof, tabs appear but with the “sizing problem” you mention, Jeff.
Using AppKit tabGroup, isTabBarVisible and isOverviewVisible I worked around the “missing resize” event by monitoring isTabBarVisible via the Paint event. Then it was straight forward to add “TabBarHidden” and “TabBarShown” events to the superclass to know when a window needs to resize.
In the superclass events I add or remove the height of tab bar as required in response to tab bar show/hide. No need to manually reposition controls in my case since they are locked, for example, to the bottom of the window and a tickle of the window forces a resize so locking does its job. Anything unique/one-off I handle in the subclass window via TabBarShown/Hidden events.
This led to the current “problem” which is: if no tab bar is showing AND one has not made the window a tab yet AND you add a new tab via the tab overview (“Show all Tabs”) the tab bar operates differently – missing the “+” on the right hand side. An edge case for sure, and may be a wild goose chase as I could of course just make all windows “tabs” upon open – even if there is only one.
I imagine this is because we’re unable to detect the creation of the first tab window via the overview.
Finally we arrive at my question – was trying to get insight into that mechanism and why tabs as described (tab bar not showing, window not added to tab group yet, tab added via overview) functions incorrectly. May well be diminishing returns at this point too.
Has anyone else gotten a working tab superclass going? Mine works and I’m sure there are nuances and improvements that could well be made!