Scrollbar width not settable.

A PtList widget has a PhAB-settable resource for scrollbar width but
editing the value in the Resource tab has no visible effect either in
PhAB view or during execution.

A PtComboBox widget inherits the same resource and, although not seen
in the Resource tab, could be set in theory by a PtSetResource() call
referring to Pt_ARG_SCROLLBAR_WIDTH. Doing so in a ComboBox Activate
callback also has no effect. (In contrast, the “drop button” width
can be changed.)

Increasing the scrollbar width is desirable for use in a touch screen
implementation for users often wearing gloves.

If I’m right, can we expect another service pack one of these days
with a fix?

This is a bug, it has been fixed. For now though, you can use this code as a
workaround:

/******************************************************* LIST_REALIZED_CB()
***/
int
list_realized_cb( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t
*cbinfo )
{
PtGenListWidget_t list = (PtGenListWidget_t)widget;
unsigned short *width;

// NOTE: Using the width which was set by user in phab.
PtGetResource( widget, Pt_ARG_SCROLLBAR_WIDTH, &width, 0 );

// This code sets the actual sizes of scrollbar(s).
if( list->scrollbar )
PtSetResource( list->scrollbar, Pt_ARG_WIDTH, *width, 0 );
if( list->hscrollbar )
PtSetResource( list->hscrollbar, Pt_ARG_HEIGHT, *width, 0 );

// This is a work around to make the list widget to
// position (anchor) scrollbars correctly (with the new size).
PtSetResource( widget, Pt_ARG_SCROLLBAR_WIDTH, *width - 1, 0 );
PtSetResource( widget, Pt_ARG_SCROLLBAR_WIDTH, *width, 0 );

return Pt_CONTINUE;
}

Attach this callback to the Pt_REALIZED of the list widget you need to set
the width on.
-Misha.

“rlb” <robert.bottemiller@fmcti-dot-com.no-spam.invalid> wrote in message
news:dhv4us$bu4$1@inn.qnx.com

A PtList widget has a PhAB-settable resource for scrollbar width but
editing the value in the Resource tab has no visible effect either in
PhAB view or during execution.

A PtComboBox widget inherits the same resource and, although not seen
in the Resource tab, could be set in theory by a PtSetResource() call
referring to Pt_ARG_SCROLLBAR_WIDTH. Doing so in a ComboBox Activate
callback also has no effect. (In contrast, the “drop button” width
can be changed.)

Increasing the scrollbar width is desirable for use in a touch screen
implementation for users often wearing gloves.

If I’m right, can we expect another service pack one of these days
with a fix?

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.

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.

Misha,

Many thanks, not only for the code that fixed the problem but for the
lesson in how to explore inside the widget family to solve a tricky
situation. Your while-loop using PtWidgetFamily() was very
instructive and provided a lead for further research in the online
help.