function createTray(){
this.icons = new Array('images/a1.png', 'images/a2.png');
//this.icons = new Array('images/6.ico', 'images/7.ico');
this.idx = 0;
this.have_new_msg = false;
this.tray = new gui.Tray({title:'System Tray',icon: this.icons[0]});
this.chgicon = function(){
if(arguments.length > 0){
nstat = arguments[0];
if (nstat == this.have_new_msg){
return; //状态未改变,不处理
}
this.have_new_msg = nstat;
}
if(!this.have_new_msg){
this.idx = 0;
this.tray.icon = this.icons[0];
}else{
//this.icons[this.idx] = this.tray.icon;
//alert(this.tray.icon);
var c ='';
for(var k in this.tray)
c += k + "="+this.tray[k] + "\n";
$('#sql').val(c);
this.idx += 1;
this.idx = this.idx % this.icons.length;
this.tray.icon = this.icons[this.idx]; //内存泄漏!!!!!!!!
//if(this.tray){ this.tray.remove(); this.tray = null; }
//this.tray = new gui.Tray({title:'System Tray',icon: this.icons[this.idx]});
}
}
};