Callback not happening when called from code.

Hi,
I set up a callback in PhAb, so when an item is selected from a listbox, I can find out what the text is in that list item, this works fine, but when I use

PtListSelectPos(ABW_ListOfNetworks,num);

To select an item in code, the item is selected visually, but the callback is not called. Is this supposed to happen? How can I get the callback to be called when the even happens from within code, rather than the user clicking?

Thanks

Garry

what’s the callback you use?

I’ve hit the same situation with other widgets. I don’t think there is any convenience functions to do this.

PtListSelectPos() does select the item but, to take a stab, your app would have to inject a button release event into the event space at the coordinates of the list item to get the desired callback to trigger.

You have to set a flag to enable callbacks to be invoked from changes due to programmatically changing a widget resource. I forget the name of the flag, but it is something like Pt_ENABLE_CALLBACKS.

Thanks to all who replied, cdm’s suggestion looks perfect!

Garry