Wrong Api Docs For Widget.newbutton On 9-Slice

I was trying the new button widget with the 9-slices imagesheet and noticed the api are not correct…

 

In the docs, the parameters required for the over (pressed) state are something like “topLeftFrameOver”  

while in reality this does not work, and instead it’s “topLeftOverFrame”.

So, not “—FrameOver” but “–OverFrame”.

 

 

Nice catch! Saved me quite a bit of time…

Here’s the missing example as welll…

[lua]

button = graphics.newImageSheet( “bit-button.png”, { width = 21, height = 10, numFrames = 9 })

local myButton = widget.newButton

{

  left = 10,

  top = 80,

  label = “Default”,

  labelAlign = “center”,

  font = “Charriot”,

  sheet = button, 

  topLeftFrame =1,

    topMiddleFrame = 2,

    topRightFrame = 3,

    middleLeftFrame = 4,

    middleFrame = 5,

    middleRightFrame = 6,

    bottomLeftFrame = 7,

    bottomMiddleFrame  = 8,    

    bottomRightFrame = 9,

  topLeftOverFrame =1,

    topMiddleOverFrame = 2,

    topRightOverFrame = 3,

    middleLeftOverFrame = 4,

    middleOverFrame = 5,

    middleRightOverFrame = 6,

    bottomLeftOverFrame = 7,

    bottomMiddleOverFrame  = 8,    

    bottomRightOverFrame = 9,    

  fontSize = 8,

  labelColor = { default = {192,192,192}, over = {255,255,255} },

  onEvent = onButtonEvent

}

myButton.baseLabel = “Default”

[/lua]

I was trying the new button widget with the 9-slices imagesheet and noticed the api are not correct…

In the docs, the parameters required for the over (pressed) state are something like “topLeftFrameOver”  

while in reality this does not work, and instead it’s “topLeftOverFrame”.

So, not “—FrameOver” but “–OverFrame”.

Indeed, sorry about this. Will get this rectified asap.

Thanks

Nice catch! Saved me quite a bit of time…

Here’s the missing example as welll…

[lua]

button = graphics.newImageSheet( “bit-button.png”, { width = 21, height = 10, numFrames = 9 })

local myButton = widget.newButton

{

  left = 10,

  top = 80,

  label = “Default”,

  labelAlign = “center”,

  font = “Charriot”,

  sheet = button, 

  topLeftFrame =1,

    topMiddleFrame = 2,

    topRightFrame = 3,

    middleLeftFrame = 4,

    middleFrame = 5,

    middleRightFrame = 6,

    bottomLeftFrame = 7,

    bottomMiddleFrame  = 8,    

    bottomRightFrame = 9,

  topLeftOverFrame =1,

    topMiddleOverFrame = 2,

    topRightOverFrame = 3,

    middleLeftOverFrame = 4,

    middleOverFrame = 5,

    middleRightOverFrame = 6,

    bottomLeftOverFrame = 7,

    bottomMiddleOverFrame  = 8,    

    bottomRightOverFrame = 9,    

  fontSize = 8,

  labelColor = { default = {192,192,192}, over = {255,255,255} },

  onEvent = onButtonEvent

}

myButton.baseLabel = “Default”

[/lua]

I was trying the new button widget with the 9-slices imagesheet and noticed the api are not correct…

In the docs, the parameters required for the over (pressed) state are something like “topLeftFrameOver”  

while in reality this does not work, and instead it’s “topLeftOverFrame”.

So, not “—FrameOver” but “–OverFrame”.

Indeed, sorry about this. Will get this rectified asap.

Thanks