|
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
Special Properties
|
string
|
Value
|
the RichText's text contents
|
Options
|
`opt(`plainText)
|
don't interpret text as HTML
|
|
`opt(`shrinkable)
|
make the widget very small
|
Sample Usage
`RichText("This is a <b>bold</b> text")
Examples
// 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>"
),
`PushButton(`opt(`default), "&OK")
)
);
UserInput();
CloseDialog();
})
|
Back to the widget index
|