You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by ccp999 <cc...@hotmail.com> on 2012/09/23 21:03:21 UTC

Tab Title Bar doesn't adjust the width properly

Hi,

I use tab pane and try to change the tab title text dynamically.  But I
found the size of title bar doesn't adjust properly unless manually click
the tab again.  Not sure if it is a bug and misuse.

<http://apache-pivot-users.399431.n3.nabble.com/file/n4022133/Screen_Shot_2012-09-24_at_2.14.38_AM.png> 

Thanks,

Brendan



--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Tab-Title-Bar-doesn-t-adjust-the-width-properly-tp4022133.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: Tab Title Bar doesn't adjust the width properly

Posted by ccp999 <cc...@hotmail.com>.
Yes, it works! Thanks



--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Tab-Title-Bar-doesn-t-adjust-the-width-properly-tp4022133p4022138.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: Tab Title Bar doesn't adjust the width properly

Posted by Roger and Beth Whitcomb <Ro...@rbwhitcomb.com>.
I just checked and this is all we do to update the title and it works 
fine, but notice we construct a new object every time:
     private void updateTabName() {
         ButtonData bd = new ButtonData(type.getIcon(), getTabName());
         TabPane.setTabData(this, bd);
     }

~Roger

On 9/23/12 8:09 PM, Roger Whitcomb wrote:
> Did you call it with the same object or did you make a new object (for 
> setTabData)?  It should be with a new object. But I will check our 
> code to see what else (if any) we did...
>
> ~Roger
>
> Sent from my iPhone
>
> On Sep 23, 2012, at 6:26 PM, ccp999 <cc...@hotmail.com> wrote:
>
>> I had tried to make the call setTabData again but nothing happened.
>>
>> <http://apache-pivot-users.399431.n3.nabble.com/file/n4022135/Screen_Shot_2012-09-24_at_9.21.49_AM.png> 
>>
>> <http://apache-pivot-users.399431.n3.nabble.com/file/n4022135/Screen_Shot_2012-09-24_at_9.22.21_AM.png> 
>>
>>
>> I use the static call and 'this' is within the Tab class.
>>
>> program is running with no complaint but nothing changed.
>> Please help!
>>
>>
>>
>> -- 
>> View this message in context: 
>> http://apache-pivot-users.399431.n3.nabble.com/Tab-Title-Bar-doesn-t-adjust-the-width-properly-tp4022133p4022135.html
>> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
>>
>
>


Re: Tab Title Bar doesn't adjust the width properly

Posted by Roger Whitcomb <Ro...@rbwhitcomb.com>.
Did you call it with the same object or did you make a new object (for  
setTabData)?  It should be with a new object. But I will check our  
code to see what else (if any) we did...

~Roger

Sent from my iPhone

On Sep 23, 2012, at 6:26 PM, ccp999 <cc...@hotmail.com> wrote:

> I had tried to make the call setTabData again but nothing happened.
>
> <http://apache-pivot-users.399431.n3.nabble.com/file/n4022135/Screen_Shot_2012-09-24_at_9.21.49_AM.png 
> >
> <http://apache-pivot-users.399431.n3.nabble.com/file/n4022135/Screen_Shot_2012-09-24_at_9.22.21_AM.png 
> >
>
> I use the static call and 'this' is within the Tab class.
>
> program is running with no complaint but nothing changed.
> Please help!
>
>
>
> --
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Tab-Title-Bar-doesn-t-adjust-the-width-properly-tp4022133p4022135.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
>

Re: Tab Title Bar doesn't adjust the width properly

Posted by ccp999 <cc...@hotmail.com>.
I had tried to make the call setTabData again but nothing happened.

<http://apache-pivot-users.399431.n3.nabble.com/file/n4022135/Screen_Shot_2012-09-24_at_9.21.49_AM.png> 
<http://apache-pivot-users.399431.n3.nabble.com/file/n4022135/Screen_Shot_2012-09-24_at_9.22.21_AM.png> 

I use the static call and 'this' is within the Tab class.

program is running with no complaint but nothing changed.
Please help!



--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Tab-Title-Bar-doesn-t-adjust-the-width-properly-tp4022133p4022135.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: Tab Title Bar doesn't adjust the width properly

Posted by Roger Whitcomb <Ro...@rbwhitcomb.com>.
Hi Brendan,
    Yes, we found that too. The problem is that just setting the text  
doesn't notify the control that something has changed that requires a  
repaint. What we did was make the "setTabData" call (I think that's  
the call -- I'm not in front of the Javadoc right now) again with the  
updated text component. That does the notification and then everything  
works right.

~Roger

Sent from my iPhone

On Sep 23, 2012, at 12:03 PM, ccp999 <cc...@hotmail.com> wrote:

> Hi,
>
> I use tab pane and try to change the tab title text dynamically.   
> But I
> found the size of title bar doesn't adjust properly unless manually  
> click
> the tab again.  Not sure if it is a bug and misuse.
>
> <http://apache-pivot-users.399431.n3.nabble.com/file/n4022133/Screen_Shot_2012-09-24_at_2.14.38_AM.png 
> >
>
> Thanks,
>
> Brendan
>
>
>
> --
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Tab-Title-Bar-doesn-t-adjust-the-width-properly-tp4022133.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.