Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » TabCtrl » TabCtrl CancelClose No longer work (as intended) (Some recent changes (could be as old as a few years) has broken its intention)
Re: TabCtrl CancelClose No longer work (as intended) [message #61143 is a reply to message #61130] Sat, 23 November 2024 19:19 Go to previous messageGo to previous message
cbpporter is currently offline  cbpporter
Messages: 1427
Registered: September 2007
Ultimate Contributor
cbpporter wrote on Thu, 21 November 2024 08:56
I'm doing a grounds up rewrite of one of the old UI projects as a refresh/modernization and I just arrived at the stage of adding TabCtrl.

Hopefully this time I can make sense of the Close variants and not occasionally still crash...

If not, I'll tell you my findings.

Might have to fork it though. We'll see...

So in the rewrite I went with maximum simplcity, since all the Close methods are confusing.

So far so good, except for one major issue: TabBar has a minimum open tab field (mintabcount) hard coded for 1.

So when I close my last tab, since I do all the internal cleanup, now my internal data has "one less tab" than TabBar. And it crashes, because tab index goes out of bounds.

How are you supposed ot handle this? Never remove the last tab?

I think I saw code in the old version disallowing the closure of the last tab and I thought that is some left over feature. But it looks like it is vital crash protection.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: TabCtrl.WhenSet is called when app closes
Goto Forum:
  


Current Time: Wed May 14 08:50:56 CEST 2025

Total time taken to generate the page: 0.03027 seconds