Multiple lines in tab labels

I have a tab control with long labels for the tabs, and I'd like to have the labels split over two lines to save space.  However, while I can use carriage returns or newlines in the commands to make the tab, I will get an error when I try to recreate the experiment, since the \r is being interpreted literally and puts carriage return in the command used to recreate the panel.

Window Panel_One_Backslash() : Panel		//Runs fine, but the created panel will cause errors the next time you open Igor
	PauseUpdate; Silent 1		// building window...
	NewPanel /W=(150,269,623,536)
	TabControl tab0,pos={29.00,21.00},size={424.00,227.00}
	TabControl tab0,tabLabel(0)="Dataset\rheader"
	TabControl tab0,tabLabel(1)="§1 Overview\rquality"
	TabControl tab0,value=0
EndMacro

//Macro when you do Ctrl+Y on the panel.  Note the broken lines for the tab labels.
Window Panel_One_Backslash_Recreation_Macro() : Panel
	PauseUpdate; Silent 1		// building window...
	NewPanel /W=(150,570,623,837)
	TabControl tab0,pos={29.00,21.00},size={424.00,227.00}
	TabControl tab0,tabLabel(0)="Dataset
header",tabLabel(1)="§1 Overview
quality"
	TabControl tab0,value=0
EndMacro

If I use \\r, the label only has one line, but will have 

I was able to hack it by using Igor Tex, but it took a little fiddling to make it look halfway decent.

Window Panel_Igor_Tex() : Panel
	PauseUpdate; Silent 1		// building window...
	NewPanel /W=(150,269,623,536)
	TabControl tab0,pos={29.00,21.00},size={424.00,227.00}
	TabControl tab0,tabLabel(0)="\JC\Z18\$WMTEX$^{\,\Dataset\,}_{\,\header\,}\$/WMTEX$"
	TabControl tab0,tabLabel(1)="\JC\Z18\$WMTEX$^{\,§1\,\Overview\,&\,}_{\,\,\quality\,}\$/WMTEX$"
	TabControl tab0,value=0
EndMacro

Is there another way to accomplish this?  You can have carriage returns in the titles of other controls, like checkboxs, so it would be nice if you can also have carriage returns in the labels for tabs.

Tab labels using Igor Tex and a simple carriage return. (12.09 KB)
Ben Murphy-Baum

This took a bit longer to dial in than I expected, but the fix is in for the next nightly build, which you'll be able to download tomorrow morning. Thanks for the report!

KZarzana

Thanks for the fix for this.  The code needs to work with IP8 and IP9, so I'll leave the Igor Tex for now.  One other question: Do you know if there is a way with Igor Tex to make the text bold?  I tried the usual LaTeX commands, but they didn't seem to work.

jjweimer

I would be surprised if the basic WMTEX includes any capacity to manage font style. You could make the annotation text as a picture and use \$PICT$name=pictName$/PICT$ as the label.

Be aware that getting text to fit into tab controls can be fraught with issues on macOS with IP 9 (and possibly IP 8). See the image for IP9 on macOS 15.8 

Also, the DefaultGUIFont command may be helpful.

Window Panel_One_Backslashc() : Panel
	PauseUpdate; Silent 1		// building window...
	NewPanel /W=(150,269,618,431)
	DefaultGuiFont/W=# all={"_IgorLarge",18,1}
	TabControl tab0,pos={29,21},size={424,100}
	// chickens picture in Misc->Pictures
	TabControl tab0,tabLabel(0)="\$PICT$name=chickens$/PICT$",value=1
	TabControl tab0,tabLabel(1)="something",value=0
	TabControl tab0,tabLabel(2)="\$WMTEX$^{\,\Dataset\,}_{\,\header\,}\$/WMTEX$"
EndMacro
image of panel made by commands (32.49 KB)