Why can't I derive the "Button" style from a custom style?

37 views
Skip to first unread message

timo.v...@gmail.com

unread,
Jan 7, 2014, 9:05:18 AM1/7/14
to codenameone...@googlegroups.com
When I create a style named "Button" and configure it explicitly to derive from "MyButton", buttons are not displayed in the MyButton style.
Is there a constraint about overriding standard styles, or am I doing something wrong?

(My assumption is that disabling "Override Attribute" and entering "MyButton" should make the "Button" style identical to "MyButton".)

timo.v...@gmail.com

unread,
Jan 7, 2014, 10:34:57 AM1/7/14
to codenameone...@googlegroups.com, timo.v...@gmail.com
Ok, I already found out that overriding a style like "Button" is very dangerous, as it is e.g. used within an OnOffSwitch component.

The better solution is to set the UIID of all buttons to "MyButton".

Shai Almog

unread,
Jan 7, 2014, 2:48:07 PM1/7/14
to codenameone...@googlegroups.com, timo.v...@gmail.com
The older buttons have some "magic" properties at the base. It sucks but its really hard to fix. We suggest using your own styles and not going overboard with inheritance for those cases.
Reply all
Reply to author
Forward
0 new messages