focus and ComboBox

I am trying to a change the fill and text color of a combo box whenever it
gets focus, I have attached a callback to Pt_CB_GOT_FOCUS to change the fill
and text color but the got focus event is never seems to be triggered. Is
this an expected action for PtComboBox or is there something I’ve forgotten.

Hi Robert,

This is a known issue, here is a workaround for it.
I attached a realised callback to the combobox and this is what the
realised function looks like.

int
realised_CB(PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t *cbinfo)
{
PtWidget_t *wp;
wp = widget->child->brother;

PtAddCallback(wp, Pt_CB_GOT_FOCUS, got_focus_CB, 0);

return (Pt_CONTINUE);
}

This should resolve your problem …If you are planning to set the
colors back to the originals when it looses focus you will need to add
another line

PtAddCallback(wp, Pt_CB_LOST_FOCUS, lost_focus_CB, 0);

Hope this helps
Regards
Brenda


Robert MacKnight wrote:

I am trying to a change the fill and text color of a combo box whenever it
gets focus, I have attached a callback to Pt_CB_GOT_FOCUS to change the fill
and text color but the got focus event is never seems to be triggered. Is
this an expected action for PtComboBox or is there something I’ve forgotten.