Shikhar13 / codenameone

Automatically exported from code.google.com/p/codenameone
0 stars 0 forks source link

buttons in tabs gets there pressedstyled cleared after 1st use #212

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have a tabcontrol with tabs. A tab is a button. I added a setPressedStyle to 
the button by doing this:

button.setPressedStyle(style); // no other way to do it since uimanager seems 
not to support it.

I press the button, and it works fine. I press it again, and now the default 
pressedstyle is shown.

Reason for this is because:

 b.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
               if(selectedTab != null){
                    selectedTab.setUIID("Tab");

As you can see the the button's uid gets set again which calls:

  pressedStyle = null;

Not nice. For me to fix this would be to also listen in and set the style back 
to what it was.

Original issue reported on code.google.com by jkoo...@gmail.com on 4 Jun 2012 at 1:34