We needed this to make removing the permanent help panel in the NCurses wizard
possible, but it might also be useful at other places (Popup.ycp?):
You can now declare a push button a "help button". When activated, that button
will now try to automatically show the help text that belongs to its dialog.
The help text is stored as a (new) widget property `HelpText in some parent
widget in that dialog, preferably a layout widget like `VBox() or `HBox().
Example: (ycp-ui-bindings/examples/HelpText.ycp)
{
UI::OpenDialog(
`VBox(`id(`mainLayout),
`Label("Hello, World!"),
`HBox(
`PushButton(`opt(`helpButton ), "&Help"),
`PushButton(`opt(`default ), "&OK")
)
)
);
UI::ChangeWidget(`mainLayout, `HelpText,
"Oh, come on, do you really need help for this?" );
UI::UserInput();
UI::CloseDialog();
}
Please note that we might do cooler stuff with this new `HelpText widget
property, so for now please use it in this way. In the future, we might use
this for tool tip help, so the dialog's help text should really be in a
container widget like this VBox and not on the help button itself (otherwise
the tool tip of that help button would be the entire dialog's help text - not
desirable). The help button will traverse up its widget hierarchy and use the
topmost `HelpText it can find.
CU
--
Stefan Hundhammer <[EMAIL PROTECTED]> Penguin by conviction.
YaST2 Development
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
Nürnberg, Germany
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]