Hi.
I hope this is not too vague.
A have a PtRaw widget inside a PtWindow widget. There are also several
other widgets inside the PtWindow widget.
When the user resizes the window, the PtRaw widget also gets resized.
Depending on the new size for the PtRaw widget, I have to allocate some new
buffers and copy the data from old buffers. Then I free the old buffers.
I have a window manager which is trapping the Ph_WM_RESIZE event. This is
where the PtWindow gets resized.
After this, where should I perform the resize for the other widgets inside
the PtWindow widget? The PtRaw widget gets resized by the PtWindow via
anchors to all its sides.
How can I force the resize to occur before the PtRaw draw function gets
called?
How does the resize mechanism work? Is this explain somewhere?
For a resize I would like to do the following things (in this order).
- PtWindow gets resized (minimum size enforced, size kept for workspace
save/restore). - Photon changes the PtWindow size.
- PtRaw widget gets resized.
- Photon changes the PtRaw widget size.
- Get PtRaw widget size (after resize). Allocate/copy/free memory for
display. - PtRaw Draw() function gets called (once for a full draw after resize).
Is this possible. How is it done?
I have no problems with step 1.
Do I need step 2? Is this a phantom step?
Where do you do step 3? Inside the Window Manager resize?
Do I need step 4? Can I force Photon to update the PtRaw widget size?
Step 5 is not working out. I need to get the PtRaw widget size using
PtBasicWidget(widget, &rect) but the size of the PtRaw widget has not
changed yet. How do I force the PtRaw widget resize?
Step 6 is also a problem. For some reason after a resize there are several
calls to the PtRaw Draw() function. I only need one. Extra calls give me
all sort of problems and I don’t need to be redrawing a complex display
several times.
Please Help.
Thanks.
Augie