Alain Bonnefoy <firstname.lastname@example.org> wrote:
?!? That’s not what the doc says!
Read from ‘Creating a List Widget’:
A pointer to a PtGenListItem_t
structure. In Pt_SELECTION_MODE_RANGE selection mode, it’s a pointer
to the first selected item. In other modes, it’s a pointer to the
item that has been selected or unselected.
The intent was to say that most of the time, it’s the item you clicked
on or the item that a keystroke just made current (and possibly selected
or unselected). If a click unselect a bunch of items and selects the
one you clicked on, you get only one callback. If you click on one of
selected items, the click unselects everything except the item you
clicked on, but you still get that item in the callback.
Also, there’s a bug in the code that has to do with handling range
selection and the Shift key, causing the callback to sometimes point you
to the wrong end to the selected range. I have just fixed it for 6.3
(thanks for making me look at this stuff…).
If that works as you say, in Pt_SELECTION_MODE_RANGE or
Pt_SELECTION_MODE_MULTIPLE, I really don’t see how can I guess what has
In some cases, you could; but in general, you need to keep track of what
was previously selected yourself, perhaps by setting one of the user