[haiku-bugs] Re: [Haiku] #12196: When setting the label of a BTab, the BTabView's tab bar is not invalidated

  • From: "waddlesplash" <trac@xxxxxxxxxxxx>
  • Date: Wed, 08 Jul 2015 13:04:04 -0000

#12196: When setting the label of a BTab, the BTabView's tab bar is not
invalidated
----------------------------------+----------------------------
Reporter: waddlesplash | Owner: axeld
Type: bug | Status: new
Priority: normal | Milestone: Unscheduled
Component: Kits/Interface Kit | Version: R1/Development
Resolution: | Keywords:
Blocked By: | Blocking:
Has a Patch: 0 | Platform: All
----------------------------------+----------------------------

Comment (by waddlesplash):

I just trusted your judgement that it has no way of knowing its
BTabView. Apparently, I shouldn't have done that.

No, my judgement is correct, and PulkoMandy's isn't. The reason is that
there are two forms of BTabView (as far as I can tell): the BCardLayout
version, and the non-BCardLayout version. The code is a bit convoluted,
but in the non-layout version, when BTabs are not the "current tab", they
aren't actually a child of the BTabView at all -- they're technically
parentless. And when adding a BTab to a BTabView, the BTabView does not
pass a pointer to itself to the BTab, so there are at least some cases
where the BTab cannot get the BTabView via ->Parent() chains.

So we can solve the problem by:
* getting rid of the non-layout version (I can't tell what it's used for,
exactly)
* making BTabView call a hook function to give BTab its address
* adding some other way for BTab to get the BTabView it's a part of

I don't know which is the correct solution, which is why I opened this
ticket rather than just implementing something.

--
Ticket URL: <https://dev.haiku-os.org/ticket/12196#comment:5>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: