[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] Crucial SelectButtonSet request




actually this might be better:



SelectButtonSet {

....

font_ { arg f;
butts.do({ |b| b.font_(f); });
}

}


g = FlowView.new;

SelectButtonSet( g,  [ "Stayin' Alive", "Boogie Nights","Disco Inferno","A 5th of Beethoven"],  
{ arg selectedIndex,selectButtonSet;
[ selectedIndex, selectButtonSet ].postln;
}, nil, nil,
160,30
)
.font_(Font("Century Gothic",16))



Seriously should get Flash and Super Collider integrated :

http://www.coverpop.com/whitney/







On May 15, 2006, at 6:53 PM, collisionist wrote:

Felix, would you consider adding the following "font" argument, or something similar, to SelectButtonSet? Maybe also in any of your other GUI classes that could take a "font" argument?  (sorry, I haven't checked these)

I like to define the fonts in GUIs, and I just *know* I'm gonna lose this hack somewhere along the way (file attached).

*new { arg layout,
/*buttonSizeX,
buttonSizeY,*/
labelArrayOrQnty=10, // integer generates numerical labels
action, // action.value(selectedIndex,this)
color,
selectedColor,
x=20,y=20,
// jpw 060422
font= Font("Helvetica", 12); // <-----------------------------------------<<

^super.new.init(layout,x,y,labelArrayOrQnty,action,color,selectedColor, font)
/* ^super.new.init(layout,x,y,labelArrayOrQnty,action,color,selectedColor)*/
}

init { arg layout,x,y,arglabelArray,argaction,
argcolorFunc,argselectedColor, font; // <----------------<<

//layout=layout.asFlowView;//PageLayout;
//layout=layout.asPageLayout;
action="">
colorFunc=argcolorFunc ?? { Color.white };
selectedColor=argselectedColor ?? {Color.red(alpha:0.7)};

if(arglabelArray.isNumber,{
labelArray=Array.series(arglabelArray,0,1) 
},{
labelArray=arglabelArray
});

  butts=
labelArray.collect({ arg la,i;
//var r;
//r = layout.layRight(x.max(la.asString.size * 7),y);
SCButton(layout,(x@y))
.states_([[la.asString,Color.black,colorFunc.value(i)],
[la.asString,Color.black,selectedColor.value(i)]])
.action_({this.select(i)})
// jpw 060422
.font_(font) // <-----------------------------------------<<
});
this.refresh;
}

Cheers, Jim
<SelectButtonSet.sc>

--
collision.ist[AT]virgin.net


_______________________________________________
sc-users mailing list