[Widget Candy] - overriding Button defaults.

My app requires that (occasionally) I have buttons that don’t proscribe to the standard lozenge look that’s defined in the graphic sheets for the theme, in fact, for my main screen I want to override the defaults and have nine, large, square buttons with single coloured backgrounds.

Looking at the docs, I see it should be possible to manually define the button height in the NewButton call and also (using the color command) to set the color of the button to a defined value, however, I tried both methods and I can’t override either parameter.

Here’s the def call:

_G.GUI.NewButton(
{
x = 153,
y = 160 + ((i * 100) + 5),
width = 490,
scale = _G.GUIScale,
name = thisButton[2],
parentGroup = Screen,
theme = “theme_5”,
caption = thisButton[1],
color = {254, 231, 239},
border = {“normal”, 1, 0, 245, 255, 245, 50},
textAlign = “center”,
onRelease = function(EventData)
Storyboard.gotoScene( thisButton[2], “slideLeft”, 800 )
end,
} )

Can anyone tell me where I’m going wrong? [import]uid: 45444 topic_id: 27349 reply_id: 327349[/import]

I’ve tried your code, and setting the color works fine at my end. However, the color you have chosen is very similar to the button’s original theme color. That might be the reason why you don’t see any difference. Try {0,255,0} to check if it works.

Setting the heigth of the button is something I’ve struggled with myself and I’m wondering if it’s a bug. Haven’t done enough testing to conclude yet though. Instead, you might want to try the NewImage widget where you can add an image of your choice to be used as a button.

[import]uid: 129287 topic_id: 27349 reply_id: 111086[/import]

Thanks Doc, I’ll try the color switch tomorrow. I had thought about using an image if there’s no other way to affect the height, but it’s a bit kludgy really :slight_smile: [import]uid: 45444 topic_id: 27349 reply_id: 111087[/import]