YaST2 Developers Documentation: YCP UI Reference: Widgets



YCP UI Widget Reference

Back to the widget index

RichText Static text with HTML-like formatting

Description

A RichText is a text area with two major differences to a Label: The amount of data it can contain is not restricted by the layout and a number of control sequences are allowed, which control the layout of the text.

Refer to the YaST2 RichText specification for details.

Arguments

string text

Special Properties

string Value the RichText's text contents

Options

`opt(`plainText) don't interpret text as HTML
`opt(`autoScrollDown) automatically scroll down for each text change
`opt(`shrinkable) make the widget very small

Sample Usage

`RichText( "This is a <b>bold</b> text" )

Examples

Example 1: RichText1.ycp

// Example for a RichText widget
{
    UI::OpenDialog( `opt(`defaultsize),
		`VBox(
		      `RichText( "<h3>RichText example</h3>"
				 + "<p>This is a <i>RichText</i> widget.</p>"
				 + "<p>It's very much like <i>HTML</i>, but not quite as powerful.</p>"
				 + "<p><b>bold</b> and <i>italic</i> you can rely on.</p>"
				 + "<p>"
				 + "<font color=blue>colored	</font>"
				 + "<font color=red>	text 	</font>"
				 + "<font color=green>	might 	</font>"
				 + "<font color=magenta>	or 	</font>"
				 + "<font color=cyan>	might 	</font>"
				 + "<font color=blue>	not	</font>"
				 + "<font color=red>	be	</font>"
				 + "<font color=green>	available,</font>"
				 + "<font color=magenta>	depending	</font>"
				 + "<font color=cyan>	on		</font>"
				 + "<font color=blue>	the		</font>"
				 + "<font color=red>	UI.		</font>"
				 + "</p>"
				 + "<p>The product name is automatically replaced by the UI."
				 + "Use the special macro <b>&product;</b> for that."
				 + "</p><p>"
				 + "The current product name is <b>&product;</b>."
				 + "</p>"
				 ),
		      `PushButton(`opt(`default), "&OK")
		      )
	     );
  UI::UserInput();
  UI::CloseDialog();
}
		

Back to the widget index


YaST2 Developers Documentation: YCP UI Reference: Widgets

Generated Fri May 21 12:39:01 2004