Here you go:
int combo_realized_cb( 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;
}
-Misha.
“rlb” <robert.bottemiller@fmcti-dot-com.no-spam.invalid> wrote in message
news:di3vki$35m$1@inn.qnx.com…
Misha,
Thanks for the code workaround. I expect it does the job for a PtList
object but I’m using a PtComboBox.
Reading more online Help about ComboBox indicates the situation may be
grim. That widget is a combination of Text and List and blocks
efforts to redefine scrollbar properties except color.
What I would really like is to match scrollbar width to the button
width (Pt_ARG_CBOX_BUTTON_WIDTH). Then, when the drop down list is
exposed and there are too many items for the visible limit, the
scrollbar would match the button in width (and color too, I would
hope).
Thanks again for your contribution – I may have to switch to a PtList
to accomodate a glove-handed touchscreen user.