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

[Sc-devel] SCPopUpMenu mouseUpAction


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.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