How to modify ComboBox inherited resources?

I want to modify SCROLLBAR_WIDTH of a PtComboBox

The inherited value of Pt_ARG_SCROLLBAR_WIDTH is 17

I try …

PtSetResource(ABW_cb_MyComboBox,Pt_ARG_SCROLLBAR_WIDTH ,30,0);

and I try…

unsigned short *flags;
PtGetResource(ABW_cb_MyComboBox,Pt_ARG_SCROLLBAR_WIDTH ,&flags,0);

(*flags)+=10;
PtSetResource(ABW_cb_MyComboBox,Pt_ARG_SCROLLBAR_WIDTH ,*flags,0);


But the size of the scrollbar is not modified

Someone can help me !

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;

}

Thanks a lot for your help. :smiley:

Now the size of the scrollbar is correctly modified

Regards,

rmaza