The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 multiline label centering with LabTalk
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

tbinford

USA
6 Posts

Posted - 06/03/2003 :  11:26:36 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

tbinford

USA
6 Posts

Posted - 06/03/2003 :  11:43:12 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 06/03/2003 :  11:49:48 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

tbinford

USA
6 Posts

Posted - 06/03/2003 :  11:58:37 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 06/03/2003 :  12:07:31 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

tbinford

USA
6 Posts

Posted - 06/03/2003 :  12:37:53 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Mike:

Thanks for the help. This will do just fine.

Tommy
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000