PtList scrollbar width not settable.

This same complaint was posted last December with no responses.
PtList scrollbar width does not respond to resource editing in PhAB
nor can you alter it in pre-realization code.
Does anyone know if this is a known bug
on the QNX To-Do list or if there is a work-around that can be used
today. The intended user of our application will likely be wearing
gloves and we need to make nice and chubby touch screen contact
points!

This is a work around (this bug is fixed in the next release).
Attach a Pt_CB_REALIZED callback:

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;
}

-Misha.


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

This same complaint was posted last December with no responses.
PtList scrollbar width does not respond to resource editing in PhAB
nor can you alter it in pre-realization code.
Does anyone know if this is a known bug
on the QNX To-Do list or if there is a work-around that can be used
today. The intended user of our application will likely be wearing
gloves and we need to make nice and chubby touch screen contact
points!

Misha,

Thanks for the work-around. I’m curious as to why, in the last two
calls to PtSetResource(), Pt_ARG_SCROLLBAR_WIDTH is set to *width-1
then immediately set to *width?

For my purposes, it appears that PtComboBox could be an alternative.
The width of the list-expanding button
does change when that resource is
edited. But I’d prefer PtList and will try your expert tip.

Thanks,
Bob

This is required because it is a work-around :wink:.
Seriously: it is required to trick the list to do the required work to apply
new scrollbar width to it.
-Misha.
“rlb” <robert.bottemiller@fmcti-dot-com.no-spam.invalid> wrote in message
news:d6vpk1$r71$1@inn.qnx.com

Misha,

Thanks for the work-around. I’m curious as to why, in the last two
calls to PtSetResource(), Pt_ARG_SCROLLBAR_WIDTH is set to *width-1
then immediately set to *width?

For my purposes, it appears that PtComboBox could be an alternative.
The width of the list-expanding button
does change when that resource is
edited. But I’d prefer PtList and will try your expert tip.

Thanks,
Bob