Select() for ListCtrl not same as mouse-click-select?

I have a ListCtrl (REPORT_MODE and SINGLE_SEL). The user can click in this to highlight an entry in it and it appears reversed.

There are times where I want to change the selected entry programmatically. I can do this with:

across_clues.Focus(idx)

across_clues.Select(idx)

(the Focus() makes sure the selected item is currently scrolled to; the Select() selects it).

This works, but the selection appearance is different here–it’s only mildly highlighted with a light grey background.

Is there a way to programmatically choose the “mouse selection” appearance?

I’ve come across posts here that suggest you can select things with

across_clues.SetItemState(idx, wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)

But this just seems to do the same thing as list.Select(…)

(Mac OSX; 2.9, Carbon)

Thanks!

Screen Shot 2012-05-25 at 12.09.06 PM.png

Screen Shot 2012-05-25 at 12.09.16 PM.png

Try calling SetFocus to move the actual system focus there. The generic ListCtrl has a mode where the you can navigate the items with the keyboard without changing the selected items, and the Focus() method just sets that item to be the one where that navigation is currently located. EnsureVisible is probably a better choice for making sure that an item is scrolled into view.

···

On 5/25/12 12:11 PM, Joel Burton wrote:

I have a ListCtrl (REPORT_MODE and SINGLE_SEL). The user can click in
this to highlight an entry in it and it appears reversed.

There are times where I want to change the selected entry
programmatically. I can do this with:

across_clues.Focus(idx)
across_clues.Select(idx)

(the Focus() makes sure the selected item is currently scrolled to; the
Select() selects it).

This works, but the selection appearance is different here--it's only
mildly highlighted with a light grey background.

Is there a way to programmatically choose the "mouse selection" appearance?

I've come across posts here that suggest you can select things with

across_clues.SetItemState(idx, wx.LIST_STATE_SELECTED,
wx.LIST_STATE_SELECTED)

But this just seems to do the same thing as list.Select(...)

(Mac OSX; 2.9, Carbon)

--
Robin Dunn
Software Craftsman