Yast UI
YPushButton Class Reference

Perform action on click. More...

Detailed Description

Perform action on click.

Following widget variants exist: PushButton IconButton

A PushButton is a button with a text label the user can press in order to activate some action. If you call UserInput() and the user presses the button, UserInput() returns with the id of the pressed button.

You can (and should) provide keybord shortcuts along with the button label. For example "& Apply" as a button label will allow the user to activate the button with Alt-A, even if it currently doesn't have keyboard focus. This is important for UIs that don't support using a mouse.

An IconButton is pretty much the same, but it has an icon in addition to the text. If the UI cannot handle icons, it displays only the text, and the icon is silently omitted.

Icons are (at the time of this writing) loaded from the theme directory, /usr/share/YaST2/theme/current.

Use a ButtonBox widget to place more PushButtons in a dialog together. Then it can properly sort the buttons on a screen depending on the selected UI (GTK, Qt, ncurses).

If a button has Opt(:helpButton) set, it is the official help button of this dialog. When activated, this will open a new dialog with the topmost help text in this dialog (the topmost widget that has a property :HelpText) in a pop-up dialog with a local event loop. Note that this is not done during UI::PollInput() to prevent the application from blocking as long as the help dialog is open.

Since a help button is handled internally by the UI, UI::UserInput() and related will never return this button's ID.

The documentation for this class was generated from the following file: