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

Re: [sc-users] Crucial SelectButtonSet request



Hi Felix

On 15 May 2006, at 23:59, crucial felix wrote:

actually this might be better:

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

Cool. Thanks for that. It's prettier. Should I put it in my own copy or will it end up in the distribution?

Seriously should get Flash and Super Collider integrated :

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

It is kinda cuddly, but I was disappointed it had nothing to do with Ms. Houston. Can't we get Flash, SuperCollider and Whitney Houston integrated?

Ta,

Jim

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=argaction;
		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
sc-users@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-users

_______________________________________________
sc-users mailing list
sc-users@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-users

--
collision.ist[AT]virgin.net