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

[sc-users] drag&drop mystery



Hi all,

I got a strange thing happening when trying to access an object
received by a drag & drop. Drop the slider on the button, and then the
button should set the slider, but it only works *sometimes*... It is
however able to access the slider object just fine for getting values.
Im using SwingOSC.

(
f = GUI.window.new;
GUI.slider.new( f, Rect( 10, 10, 100, 120 ))
.beginDragAction_({ |sl| sl });

b= GUI.button.new( f, Rect( 10, 160, 130, 24 ))
.states_( [[ "Drop slider on me" ], ["Drop slider on me", Color.red]])
.canReceiveDragHandler_({ true })
 .receiveDragHandler_({
		var gui;
		gui= GUI.view.currentDrag;

	 b.action = {|v|
		 gui.value= v.value; //this works *sometimes*, but mostly not
		 //gui.postln; //works
		 //gui.value.postln; //works
	 }
 });

};
f.front;
)


best,
martin

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/