collections { group { name: "main"; script { public toggle() { set_state(PART:"button", "active", 0.0); } } parts { part { name: "button"; type: RECT; mouse_events: 1; description { state: "default" 0.0; color: 0 255 0 255; } description { state: "active" 0.0; color: 0 0 255 255; } } } programs { program { name: "set"; signal: "mouse,clicked,1"; source: "*button*"; script { // If call the function here it works // toggle(); new exp[] = "button"; // These expressions work okay //if ( !strcmp(exp, "button")) { //if ( !fnmatch("button", src) ) { if ( !fnmatch(exp, src) ) { toggle(); } } } } } }