YaST2 Developers Documentation: YCP UI Reference: Widgets



YCP UI Widget Reference

Back to the widget index

HSquash
VSquash
HVSquash
Layout aid: Minimize widget to its nice size

Description

The Squash widgets are used to control the layout. A HSquash widget makes its child widget nonstretchable in the horizontal dimension. A VSquash operates vertically, a HVSquash in both dimensions. You can used this for example to reverse the effect of `Left making a widget stretchable. If you want to make a VBox containing for left aligned CheckBoxes, but want the VBox itself to be nonstretchable and centered, than you enclose each CheckBox with a `Left( .. ) and the whole VBox with a HSquash( ... ).

See the Layout HOWTO for details.

Arguments

term child the child widget

Special Properties

None

Sample Usage

HSquash( `TextEntry( "Name:" ) )

Examples

Example 1: HSquash1.ycp

{
    UI::OpenDialog(`opt(`defaultsize),
	       `VBox(
		     `VCenter( // Makes the HSquash stretchable vertically
			      `HSquash( // Makes the VBox nonstretchable horizontally
				       `VBox(
					     `Left(`CheckBox("short")),
					     `Left(`CheckBox("longer")),
					     `Left(`CheckBox("even longer")),
					     `Left(`CheckBox("yet even longer"))))),
		     `Left(`PushButton("bottom left"))
		     )
	       );
    
    UI::UserInput();
    UI::CloseDialog();
}
		

Back to the widget index


YaST2 Developers Documentation: YCP UI Reference: Widgets

Generated Fri May 21 12:39:01 2004