repost: PtClock Bug

Setting the seconds of PtClock_t through the Pt_ARG_CLOCK_SECOND
actually
changes the minute. That is, the minute hand moves.

Hello Bruno

What version of QNX RTP are you using?

Thanks
Rodney


Previously, bruno suarez wrote in qdn.public.qnxrtp.photon:

Setting the seconds of PtClock_t through the Pt_ARG_CLOCK_SECOND
actually
changes the minute. That is, the minute hand moves.

Just fixed this internally, thanks for noticing :slight_smile:

bruno suarez <bruno.suarez@scola.ac-paris.fr> wrote:

Setting the seconds of PtClock_t through the Pt_ARG_CLOCK_SECOND
actually
changes the minute. That is, the minute hand moves.

Patch A

gui@qnx.com” wrote:

Hello Bruno

What version of QNX RTP are you using?

Thanks
Rodney

Previously, bruno suarez wrote in qdn.public.qnxrtp.photon:
Setting the seconds of PtClock_t through the Pt_ARG_CLOCK_SECOND
actually
changes the minute. That is, the minute hand moves.

Greetings,

The following workaround can be used to update the seconds on a clock.

// new_seconds is a short with the new value for seconds.
// old_seconds is a pointer to a short
// ABW_clock is the PtClock widget

// Retrieve a pointer to the widgets internal second data.
PtGetResource ( ABW_clock, Pt_ARG_CLOCK_SECOND, &old_second, 0 )

// Is the pointer valid?
if ( old_second )
{
// If so …

// Change the internal second data.
*old_second = new_second;
// Ensure the widget is re-drawn.
PtDamageWidget ( ABW_clock );
}

It should be noted that changing the internal buffer of a widget in this
fashion is not advisable. It is done in this case only because of the
problem with setting the resource.

]{ristoph

<gui@qnx.com> wrote in message news:Voyager.010301111728.585766B@rdowdall…

Hello Bruno

What version of QNX RTP are you using?

Thanks
Rodney


Previously, bruno suarez wrote in qdn.public.qnxrtp.photon:
Setting the seconds of PtClock_t through the Pt_ARG_CLOCK_SECOND
actually
changes the minute. That is, the minute hand moves.