T O P I C R E V I E W |
peter.cook |
Posted - 09/02/2002 : 06:31:36 AM HI,
Can existing buttons and labels be attached to different layers via labtalk eg I may have 24 layer temp[lates with 3 buttons attached per layer that I would like to later so that all buttons are attached to layer1?
Cheers,
Pete
|
2 L A T E S T R E P L I E S (Newest First) |
peter.cook |
Posted - 09/02/2002 : 10:02:07 AM Hi Mike,
Thanks - this is v helpful and exactly what I needed. Save as .ogo and opening just didn't occur. Minor modification to the code used to retain previous postions eg
oldtop=button.top; oldleft=button.left;
then
newbutton.top=oldtop; newbutton.left=oldleft;
Thanks again,
Pete
|
Mike Buess |
Posted - 09/02/2002 : 09:16:15 AM Hi Pete,
Note: The following describes how to move a button that runs a script. For simple text labels just copy the text (%Z=labelname.text$), remove the label and recreate it on layer 1.
There is no Labtalk "move" command, but this is how I would move a button named btn1 from layer 2 to layer 1 using Labtalk...
page.active=2; // activate layer 2 draw -n btn1 -f save %Ybtn.ogo; // save btn1 as the object file btn.ogo label -r btn1; // remove btn1 from layer 2 page.active=1; // activate layer 1 draw -n btn1 -f read %Ybtn.ogo; // create an object from btn.ogo and name it btn1
If you've named the buttons systematically (e.g., btn1, btn2, btn3 for each layer) then you could embed those scripts inside a couple of loops...
loop(ii,2,24) { loop(jj,1,3) { page.active=ii; draw -n btn$(jj) -f save %Ybtn.ogo; label -r btn$(jj); page.active=1; draw -n L$(ii)btn$(jj) -f read %Ybtn.ogo; }; };
...You'd end up with buttons btn[1-3], L2btn[1-3], ..., L24btn[1-3] on layer 1.
Moving objects between layers (or windows) should be more straigtforward in OriginC, but I don't know how yet. Anyone else?
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 09/02/2002 09:37:51 AM |
|
|