| Author |
Topic  |
|
|
tbinford
USA
6 Posts |
Posted - 06/03/2003 : 11:26:36 AM
|
Help:
I am trying to format an Origin7 graph using LabTalk. I want to make a multiline label (say a title) and center the text. In a script window, the following does not work:
label -j 1 -sa -n MYTITLE This is a\nCentered Multiline Label; doc -uw;
None of the -j n options seem to work.
Thanks, Tommy |
|
|
Mike Buess
USA
3037 Posts |
Posted - 06/03/2003 : 11:40:23 AM
|
Hi Tommy,
Option order is important with the label command. Try this...
label -sa -n MYTITLE -j 1 "This is a\nCentered Multiline Label";
Mike Buess Origin WebRing Member |
 |
|
|
tbinford
USA
6 Posts |
Posted - 06/03/2003 : 11:43:12 AM
|
Actually, I just discovered part of the problem. The -j n option doesn't seem to have an effect on a label which has been created. If a label already exists, then the justification cannot be modified the way I am doing it. For a brand new label, this produces the desired result:
label -j 1 -sa -n NEWLABEL This is a\ncentered multiline label;
However, the following does not change the label to left justified.
label -j 0 -sa -n NEWLABEL This is not a\nleft-justified multiline label;
I'm sure there is just something silly I have neglected to do. Please advise.
Best, Tommy |
 |
|
|
Mike Buess
USA
3037 Posts |
Posted - 06/03/2003 : 11:49:48 AM
|
I got the order wrong myself last time. this works...
label -sa -j 1 -n MYTITLE "This is a\nCentered Multiline Label";
...However, you seem to be right about not being able to change the justification of an existing label.
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 06/03/2003 11:58:56 AM |
 |
|
|
tbinford
USA
6 Posts |
Posted - 06/03/2003 : 11:58:37 AM
|
Mike:
You are correct. The LabTalk Manual states the last option must be -n. It also seems that the label command, when using the option switches, is only good for creating a label. Therefore, executing the code
label -sa -j 0 -n MYTITLE "Some text\nand another line of text";
followed by
label -sa -j 1 -n MYTITLE "Some text\nand another line of text";
does not change the justification. Is this correct?
Tommy |
 |
|
|
Mike Buess
USA
3037 Posts |
Posted - 06/03/2003 : 12:07:31 PM
|
Hi Tommy,
The only way I can think of to change the justification of an existing label is to remove and recreate it. Once you've got your left-justified label called MYTITLE, you use this to center it...
%Z=MYTITLE.text$; // get text label -r MYTITLE; // delete label label -s -sa -j 1 -n MYTITLE %Z; // recreate center-justified.
That may not be exactly what you're looking for but it should work.
Mike Buess Origin WebRing Member |
 |
|
|
tbinford
USA
6 Posts |
Posted - 06/03/2003 : 12:37:53 PM
|
Mike:
Thanks for the help. This will do just fine. 
Tommy |
 |
|
| |
Topic  |
|