Hello,
I try to tune up my toolbar → I want to dynamically change the style of a button via code.
I test with two styles : icon-empty, icon-system
My button is defined like that :
And when I want to change it via code :
[java]
element.setStyle( "icon-system" );
[/java]
Nothing change on the GUI, but I have thins in the log :
INFO: before removeStyle [nifty-button]
[element] (style => nifty-button, name => button, imageMode => resize:2,148,2,2,2,148,2,28,2,148,2,2 {nifty-button#panel}, id => btn0, width => 100%, controller => de.lessvoid.nifty.controls.button.controller.ButtonControl, inputMapping => de.lessvoid.nifty.input.mapping.MenuInputMapping, type => button, focusable => true, backgroundImage => button/black-button-normal.png {nifty-button#panel}, childLayout => center {nifty-button#panel}, visibleToMouse => true {nifty-button#panel}, height => 10%)
(onClick => toggleSheet(0))
()
(imageMode => resize:7,148,7,7,7,148,7,28,7,148,7,7, inset => -5px, filename => button/black-button-hover.png, name => imageOverlay, post => true)
()
(imageMode => resize:7,148,7,7,7,148,7,28,7,148,7,7, inset => -5px, filename => button/black-button-hover.png, name => imageOverlay, post => true)
(inherit => true, name => move, length => 2000, direction => top, startDelay => 20, mode => in)
children elements: 1
[element] (style => #text, id => button-text, textHAlign => center {nifty-button#text}, font => aurulent-sans-16-bold.fnt {button-font}, textVAlign => center {nifty-button#text}, align => center {nifty-button#text}, valign => center {nifty-button#text}, visibleToMouse => false {nifty-button#text})
()
()
no children elements
Nov 27, 2010 8:54:37 PM de.lessvoid.nifty.elements.Element removeStyle
INFO: after removeStyle [nifty-button]
[element] (style => nifty-button, name => button, imageMode => resize:2,148,2,2,2,148,2,28,2,148,2,2 {nifty-button#panel}, id => btn0, width => 100%, controller => de.lessvoid.nifty.controls.button.controller.ButtonControl, inputMapping => de.lessvoid.nifty.input.mapping.MenuInputMapping, type => button, focusable => true, backgroundImage => button/black-button-normal.png {nifty-button#panel}, childLayout => center {nifty-button#panel}, visibleToMouse => true {nifty-button#panel}, height => 10%)
(onClick => toggleSheet(0))
()
(imageMode => resize:7,148,7,7,7,148,7,28,7,148,7,7, inset => -5px, filename => button/black-button-hover.png, name => imageOverlay, post => true)
()
(imageMode => resize:7,148,7,7,7,148,7,28,7,148,7,7, inset => -5px, filename => button/black-button-hover.png, name => imageOverlay, post => true)
(inherit => true, name => move, length => 2000, direction => top, startDelay => 20, mode => in)
children elements: 1
[element] (style => #text, id => button-text, textHAlign => center {nifty-button#text}, font => aurulent-sans-16-bold.fnt {button-font}, textVAlign => center {nifty-button#text}, align => center {nifty-button#text}, valign => center {nifty-button#text}, visibleToMouse => false {nifty-button#text})
()
()
no children elements
Nov 27, 2010 8:54:37 PM de.lessvoid.nifty.elements.Element setStyle
INFO: after setStyle [icon-system]
[element] (style => icon-system, name => button, imageMode => resize:2,148,2,2,2,148,2,28,2,148,2,2 {nifty-button#panel}, id => btn0, width => 100%, controller => de.lessvoid.nifty.controls.button.controller.ButtonControl, inputMapping => de.lessvoid.nifty.input.mapping.MenuInputMapping, type => button, focusable => true, backgroundImage => button/black-button-normal.png {nifty-button#panel}, childLayout => center {nifty-button#panel}, visibleToMouse => true {nifty-button#panel}, height => 10%)
(onClick => toggleSheet(0))
()
(imageMode => resize:7,148,7,7,7,148,7,28,7,148,7,7, inset => -5px, filename => button/black-button-hover.png, name => imageOverlay, post => true)
()
(imageMode => resize:7,148,7,7,7,148,7,28,7,148,7,7, inset => -5px, filename => button/black-button-hover.png, name => imageOverlay, post => true)
(inherit => true, name => move, length => 2000, direction => top, startDelay => 20, mode => in)
children elements: 1
[element] (style => #text, id => button-text, textHAlign => center {nifty-button#text}, font => aurulent-sans-16-bold.fnt {button-font}, textVAlign => center {nifty-button#text}, align => center {nifty-button#text}, valign => center {nifty-button#text}, visibleToMouse => false {nifty-button#text})
()
()
no children elements
Nov 27, 2010 8:54:37 PM de.lessvoid.nifty.effects.EffectProcessor startEffect