Hi
A problem with the SCPopUpMenu is that it doesn't perform anything
when
clicked on and released on the same item. I think it should perform
the action,
or at least have a flag whether or not to do so.
A solution is to put an .addAction there, as here below.
(
var sbs;
w = SCWindow.new.front;
l = [
"right view","right thinking","right mindfulness","right speech",
"right action","right diligence","right concentration","right
livelihood"
];
sbs = SCPopUpMenu(w,Rect(10,10,180,20));
sbs.items = l;
sbs.background_(Color.white);
sbs.action = { arg sbs;
[sbs.value, l.at(sbs.value)].postln; // .value returns the integer
};
sbs.addAction({"mouse".postln; sbs.action.value( sbs.value )},
\mouseDownAction);
)
The problem is that it is kind wrong to evaluate the action on
mouse down as the user
might be going somewhere else or deciding to choose the same item.
It should be on \mouseUpAction. However that doesn't work....
Could this be fixed?
I hope so, this has been irritating me for a few years now
thor
_______________________________________________
Sc-devel mailing list
Sc-devel@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-devel