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

[sc-users] Re: drag&drop mystery



oops - now also with code that actually executes:

(
f = GUI.window.new("", Rect(0, 0, 160, 200));
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;
)

can anyone confirm if this happens in cocoa as well?

cheers,
martin

On Mon, Dec 29, 2008 at 3:32 PM, Martin . <blindmanonacid@xxxxxxxxx> wrote:
> 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/