this is a bug in Phab or Photon. Hope this is fixed in 6.4 but here is a work around.
call this function after setting the width.
int
cbox_scrollbar_width_fix( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t *cbinfo ) {
PtGenListWidget_t *list;
PtWidget_t *wp = widget;
unsigned short *width, list_width;
// NOTE: Using the width that was set in phab.
PtGetResource( widget, Pt_ARG_CBOX_BUTTON_WIDTH, &width, 0 );
// Find the list widget in the combo
while( (wp = PtWidgetFamily( widget, wp )) ) {
if( PtWidgetIsClass( wp, PtList ) ) {
list = (PtGenListWidget_t *) wp;
break;
}
}
if( !wp )
return Pt_CONTINUE;
list_width = *width + 2;
// This code sets the actual sizes of scrollbar(s).
if( list->scrollbar )
PtSetResource( list->scrollbar, Pt_ARG_WIDTH, list_width, 0 );
if( list->hscrollbar )
PtSetResource( list->hscrollbar, Pt_ARG_HEIGHT, list_width, 0 );
// This is a work around to make the list widget to
// position (anchor) scrollbars correctly (with the new size).
PtSetResource( wp, Pt_ARG_SCROLLBAR_WIDTH, list_width - 1, 0 );
PtSetResource( wp, Pt_ARG_SCROLLBAR_WIDTH, list_width, 0 );
return Pt_CONTINUE;