• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

MenuBar Misguiding

FAQ

Tom Asks Why

Why would you ever bother with creating style objects? Because it can save time. If you have some styles that you want to apply to some components, but not to all of them, then you can specify those styles once, stick them in a style object, and tell all those components to look at the single style object. Otherwise, your code would look like this:

aButton.fontFamily = "verdana";
aButton.fontSize = 15;
aButton.fontWeight = "bold";
aButton.color = 0x336699;
aButton.setStyle("themeColor", 0xE1F412);

someLabel.fontFamily = "verdana";
someLabel.fontSize = 15;
someLabel.fontWeight = "bold";
someLabel.color = 0x336699;
someLabel.setStyle("themeColor", 0xE1F412);

With two components, it's no big deal, but if you had, say, 20, then it would be a pain in butt to change all of them if you decided you needed a slightly darker shade of blue or a smaller font size.


Now, you might hear something here and there about the following being style properties for the MenuBar component:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint