Mailinglist Archive: yast-devel (129 mails)

< Previous Next >
Re: [yast-devel] How to preselect a table entry?
  • From: Stefan Hundhammer <sh@xxxxxxx>
  • Date: Mon, 26 Nov 2007 12:52:39 +0100
  • Message-id: <200711261252.39812.sh@xxxxxxx>
On Friday 23 November 2007 10:39, Johannes Meixner wrote:
[Preselecting and deselecting table etc. items]

This used to be not as consistent as we had liked it to be. But now with the
new mod-ui it is consistent:

- All widgets that somehow handle selecting things now have a common base
class YSelectionWidget:

- SelectionBox
- ComboBox
- Table
- Tree
- MultiSelectionBox
- MenuButton

(MenuButton might be not that obvious, but it also has items and subitems and
the user can select one of those items).

- Most of those widgets (except MultiSelectionBox) have a "single selection"
strategy, i.e., no more than one item can be selected at the same time. To
make life easier for applications, they make sure one widget is selected when
the widget is created (with items) or when all items are replaced.

If the application does not specify an item to select (which most of those
widgets support with a boolean parameter in the `item() term - except the
table widget), the first item is automatically selected.

- It was requested (and it makes sense) that applications also can deselect
all items. You can now do that from YCP with

UI::ChangeWidget(`myWidget, `Value, nil )

or with

UI::ChangeWidget(`myWidget, `CurrentItem, nil )

(For all SelectionWidgets except MultiSelectionBox `Value is an alias for
`CurrentItem).


CU
--
Stefan Hundhammer <sh@xxxxxxx> Penguin by conviction.
YaST2 Development
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
Nürnberg, Germany
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >