PtMultiText / Unrealize / Realize

Hi,

I need to hide or show a PtMultiText widget when the user decide it,
when I use PtRealize & PtUnrealize it takes up to 2 or 3 seconds
before redrawing realizing the widget when there is a lot of data in it.

Is there any trick that could make it faster ?

Regards.

jhroyer <jhroyer@joher.com> wrote:

Hi,

I need to hide or show a PtMultiText widget when the user decide it,
when I use PtRealize & PtUnrealize it takes up to 2 or 3 seconds
before redrawing realizing the widget when there is a lot of data in it.

Is there any trick that could make it faster ?

Regards.

Move it out of the way :slight_smile: Seriously, set it’s Pt_ARG_POS to something
very negative so the user will no longer see it. You might also want
to set the Pt_BLOCKED flag so that it cannot get focus while “hidden”.

In general that’s an acceptable way to hide widgets since unrealizing
and realizing are fairly expensive procedures (regions have to be
create/destroyed etc etc etc)

Yup that’s what darin suggested, I think I’m gonna use it if I can’t
find better.

It’s a little bit harder because these PtMultiText widgets have
anchors, so I’ve to remove anchors before moving them out
(to prevent resize of all the hidden PtMultiText that would takes
so much time) and then, when shown, put the anchors back with the new size if the parent window has been resized while.

The good thing was that an unrealized widget keeps being resized
if parent window is, but since it’s not realized it’s doesn’t
take time to redraw, that was fast.

isn’t there any way to ask a widget to never redraw then later to
let it redraw if (and only if) there was a change ?

PtContainerHold/Release will always redraw even if no change if i understand right ?

what about PtStart/EndFlux ?

Regards.

Previously, dleblanc@qnx.com wrote in qdn.public.qnxrtp.photon:

Move it out of the way > :slight_smile: > Seriously, set it’s Pt_ARG_POS to something
very negative so the user will no longer see it. You might also want
to set the Pt_BLOCKED flag so that it cannot get focus while “hidden”.

In general that’s an acceptable way to hide widgets since unrealizing
and realizing are fairly expensive procedures (regions have to be
create/destroyed etc etc etc)

jhroyer <nospam28@joher.com> wrote:

Yup that’s what darin suggested, I think I’m gonna use it if I can’t
find better.

It’s a little bit harder because these PtMultiText widgets have
anchors, so I’ve to remove anchors before moving them out
(to prevent resize of all the hidden PtMultiText that would takes
so much time) and then, when shown, put the anchors back with the new size if the parent window has been resized while.

The good thing was that an unrealized widget keeps being resized
if parent window is, but since it’s not realized it’s doesn’t
take time to redraw, that was fast.

isn’t there any way to ask a widget to never redraw then later to
let it redraw if (and only if) there was a change ?

PtContainerHold/Release will always redraw even if no change if i understand right ?

what about PtStart/EndFlux ?

Regards.

Previously, > dleblanc@qnx.com > wrote in qdn.public.qnxrtp.photon:
Move it out of the way > :slight_smile: > Seriously, set it’s Pt_ARG_POS to something
very negative so the user will no longer see it. You might also want
to set the Pt_BLOCKED flag so that it cannot get focus while “hidden”.

In general that’s an acceptable way to hide widgets since unrealizing
and realizing are fairly expensive procedures (regions have to be
create/destroyed etc etc etc)

PtContainerHold increments the hold count on the widget (widgets don’t redraw
while they are held) by calling PtStartFlux(). PtContainerRelease decrements
the hold count by calling PtEndFlux. The difference with PtContainerRelease is
that if the hold count hits 0, then the widget is damaged. PtEndFlux won’t
damage the widget for you.