[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sc-users] Re: drag&drop mystery
- To: sc-users@xxxxxxxxxxxxxxxx
- Subject: [sc-users] Re: drag&drop mystery
- From: "Martin ." <blindmanonacid@xxxxxxxxx>
- Date: Tue, 30 Dec 2008 00:16:17 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=x47jHg0JDOM/ZArTdQ9JE/RD5UOy7ZDNrBzULXPHYNo=; b=W/4ol3dljRlXaOdnu+ztoAQzWdM5ymPYp0iv6mk3P373imQQxJ7BLZDilwg0GoH9uY OWLuk1zAT6kxiEI+9FOr5VgeubGhIhJZRSa/VRRdH7Wg1IFG5nrYIumTXnkMJl+6dBcx f/ShUTubzPlmJ+8vjxaxZPEYQ794IG91UKItg=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=aO4mlc/kaLgVPyzuh9u7W6/GXKyXI+hADbuU1ULG8hAHM5sGsfAbPac0ShxVvwB1JJ J0MOKNLtBuOLA6ZA/tSZUhtfbVlVO0iTkm1XicySnkp5czTA2oFeGaiOjytEEE3SPLSD +BI7Oo1YIkLFaPrBM3BnQ5UCoyyYL0JGtRgHU=
- In-reply-to: <d3c4e9f20812290632y1966d289p5378aab50143ece3@xxxxxxxxxxxxxx>
- List-id: SuperCollider users mailing list <sc-users.create.ucsb.edu>
- References: <d3c4e9f20812290632y1966d289p5378aab50143ece3@xxxxxxxxxxxxxx>
- Reply-to: sc-users@xxxxxxxxxxxxxxxx
- Sender: owner-sc-users@xxxxxxxxxxxxxxxx
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/