TabbedComponent callback w/o derivation

5 posts / 0 new
Last post
cpr
cpr's picture
Offline
Last seen: 1 hour 3 min ago
Joined: 25 Apr 2008 - 23:49
TabbedComponent callback w/o derivation

Is it possible to get some sort of callback from the TabbedComponent without deriving my own class from it? ie. like addListener or addButtonListener?

I have the same controls on all the pages, and instead of having actual copies of the controls on each page, I want to simply update the contents of the controls, that I've layed over the tab control, when the user changes which tab is currently displayed.

jules
Offline
Last seen: 6 hours 43 min ago
Joined: 29 Apr 2013 - 18:37

It's a good request, will do that when I get chance.

mdsp
Offline
Last seen: 3 months 6 days ago
Joined: 29 Oct 2004 - 12:00

why not using a TabbedButtonBar? and subscribe to it as a ChangeListener?

we do that to avoid instantiation of all tabbed Components even if they are not visible.

however it would be great if it was a built-in feature of TabbedComponent.

I have another related request: separate the tab background colour from the tabs content background colour.

in many cases it makes sense to have a transparent content background but an opaque tab colour.

at the moment we are cheating by using transparent tabs colours but imposing an opaque colour in the LookAndFeel tab drawing code, which is not very elegant IMHO.

lalala
Offline
Last seen: 2 days 16 hours ago
Joined: 11 Mar 2011 - 07:52
Re: TabbedComponent callback w/o derivation

Quote:

Is it possible to get some sort of callback from the TabbedComponent without deriving my own class from it? ie. like addListener or addButtonListener?
Quote:

It's a good request, will do that when I get chance.

I'm sad it seems you never got chance :)

jules
Offline
Last seen: 6 hours 43 min ago
Joined: 29 Apr 2013 - 18:37
Re: TabbedComponent callback w/o derivation

Quote:
I'm sad it seems you never got chance

Huh? The TabbedButtonBar is a ChangeBroadcaster. And the TabbedComponent has actually changed a lot since this thread was written.. If you have a specific problem with what you're trying to do, feel free to ask about it.