|
YCP UI Widget Reference
Back to the widget index
Empty HStretch VStretch HVStretch
|
Stretchable space for layout
|
|
Description
These four widgets denote an empty place in the dialog. They differ
in whether they are stretchable or not. Empty is not stretchable
in either direction. It can be used in a `ReplacePoint, when
currently no real widget should be displayed. HStretch and VStretch
are stretchable horizontally or vertically resp., HVStretch is
stretchable in both directions. You can use them to control
the layout.
See the Layout HOWTO for details.
Arguments
None
Special Properties
None
Sample Usage
`HStretch()
Examples
{
UI::OpenDialog(
`VBox(
`Label("Some text goes here"),
`Label("This is some more text, that is quite long, as you can see."),
`HBox(
`PushButton("&OK"),
`HStretch()
)
)
);
any ret = UI::UserInput();
UI::CloseDialog();
return ret;
}
|
{
// Layout example:
//
// Build a dialog with three equal sized buttons.
//
// The equal `HWeight()s will make the buttons equal sized.
// When resized larger, all buttons will retain their size.
// Excess space will go to the HStretch() widgets between the
// buttons, i.e. there will be empty space between the buttons.
UI::OpenDialog(
`HBox(
`HWeight(1, `PushButton( `opt(`default), "&OK" ) ),
`HStretch(),
`HWeight(1, `PushButton( "&Cancel everything" ) ),
`HStretch(),
`HWeight(1, `PushButton( "&Help" ) )
)
);
UI::UserInput();
UI::CloseDialog();
}
|
Back to the widget index
|