I want create some State-sensitive iconbuttons in my script.
But I can's change the iconbutton to another image when it unable?
It's mean: When I click one of the iconbuttons,it convert to unable and auto change to another image.
This are some code of under.
Sorry of my BAD English.
Thank very much!
.................
.................
//config iconbutton's different iamges.( _a is the normal image,_b is the unable image. )
//I don't know which is the right way, or all wrong.
var icon1 = {a:File("\icon\Icon_M1a.png"),b:File("\icon\Icon_M1b.png")} ;
var icon1x = {a:"./icon/Icon_M1a.png",b:"./icon/Icon_M1b.png"} ;
.................
.................
//BuildUI by under format.
//My UI code is very complex, under is some line of it.
.................
.................
Pleft: Group { \
orientation:'column', alignment:['left','fill'], margins: 0, spacing: 0, \
grmm1: Group { margins: 0, spacing: 0, \
MBtn1: IconButton { text:'',preferredSize: [32, 32],image:("+icon.a+","+icon.b+")} \ //ERROR!! I don't know the right way.
MBtn2: IconButton { text:'',preferredSize: [32, 32],image:'./icon/Icon_M2a.png' } \
MBtn3: IconButton { text:'',preferredSize: [32, 32],image:'./icon/Icon_M3a.png' } \\
.................
.................
//Unable the iconButton when mouse click.
...MBtn1.onClick = function () {
this.enabled = false ;
...MBtn2.enabled = ...MBtn3.enabled = ture ;
.................
.................