Am 10.06.2013 19:54, schrieb Angelo Naselli:
No, SelectionChanged wasn't emitted before because the position in
the list is unchanged when item is toggled and the condition:
if ( citem != getCurrentItem() )
hasn't applied.
SelectionChanged is emitted for single and multi selection if position in list has changed (scrolled up/down). indeed the problem is there imo.
It's intended and conform to all widgets concerned (SelectionBox, MultiselectionBox, Table, Tree), SelectionChanged means the position in the list has changed.
You asked for the difference between YTableCheckBoxOnFirstColumn and YTableMultiSelection, and imo all is there.
Where? I didn't find documentation in YTypes.h: +enum YTableMode { + YTableSingleLineSelection, + YTableMultiSelection, + YTableCheckBoxOnFirstColumn, + YTableCheckBoxOnLastColumn + };
Multiselection, as the second part of the word says, is concerning selection. That is clear in GUI, not in ncurses since is represented by check boxes. I believe Multiselection should emit a SelectionChanged event because the selection has changed... and not a valueChanged because of the item. Instead with YTableCheckBoxOn[First|Last]Column a checked column means that the item is changed so a valueChanged is more appropriated than a selection changed. The naming might be confusing, but as written before, SelectionChanged is used for list position changes and ValueChanged is emitted conform to MultiSelectionBox if an list item is toggled.
Anyway I'm always open to discuss, but I need also answers, if my code is not correct, it does not make sense etc, how can i manage my needs, in a simple way as libyui allows, without specializing code for gtk, qt and ncurses?
For an application it rarely matters which exact type of event is sent. Example: Have a list of packages and let the user select several lines (which means multiSelection mode of the table widget). And have an Ok (Install) button. The user clicks Ok and you want to install the selected packages. In this case it doesn't matter which events are sent during checking (selecting), you simple have to get the list of selectedItems after getting the activated event of the OK button. In your case: do you want to react on changes concerning the selection (the checked items) immediately? libyui-ncurses now returns the ValueChanged event and you can check for this (has to be added for qt). -- Gabriele Mohr SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Maxfeldstr. 5 Tel: +49 911 740 53 362 90409 Nürnberg Email: gs@suse.de ----------------------------------------------------------------- -- To unsubscribe, e-mail: libyui-devel+unsubscribe@opensuse.org To contact the owner, e-mail: libyui-devel+owner@opensuse.org