I’m still waiting to find out why PtBlit() is damaging my widget
(I.E. forcing my draw_f() function ot be called.
I have a new problem.
In my draw function I call:
PhRect_t my_rect;
PtCalcCanvas( widget, &my_rect );
PgSetTranslation( &my_rect.ul, PgRELATIVE );
/* draw stuff */
my_rect.ul.x *= -1;
my_rect.ul.y *= -1;
PgSetTranslation( &my_rect.ul, PgRELATIVE );
where ‘widget’ is from the draw callback, and this works. Everything I
draw is where I expect it to be.
Later in the program some external event occurs and I try to display a
new object on the PtRaw widget. I call:
PhRect_t my_rect;
PtCalcCanvas( ABW_my_widget, &my_rect );
PgSetTranslation( &my_rect.ul, PgRELATIVE );
/* draw stuff */
my_rect.ul.x *= -1;
my_rect.ul.y *= -1;
PgSetTranslation( &my_rect.ul, PgRELATIVE );
but the translation is off. I.E. it draws too high. Above my PtRaw
widget actually. Note: I left the clipping off just so I could see
where it was drawing.
Why is my translation wrong?
In th PgSetTranslation(), PgRELATIVE is relative to what?
Note: there is no telling what widget had focus when the additional
draw was attempted.
Bill Caroselli <qtps@earthlink.net> wrote:
BC > Bill Caroselli <qtps@earthlink.net> wrote:
BC > BC > Dave Rempel <drempel@qnx.com> wrote:
BC > BC > DR > Bill Caroselli wrote:
My thoughts were this:
- Use a PtRaw and draw what I need as I need it. But can I blit my
PtRaw image?
BC > BC > DR > Yes, using PtBlit()
BC > BC > I’m using a PtRaw inside of a PtOSContainer inside of a PtPanelGroup
BC > BC > inside of my main window.
BC > BC > Also on my main window I have a PtButton I’ve added for diagnostic
BC > BC > purposes. It calls the routine that PtBlit()s my PtRaw by one pixel
BC > BC > row.
BC > BC > The blitting is working, BUT the draw function for my PtRaw is also
BC > BC > being called. Nothing should be damaging the widget.
BC > BC > Why is the draw function being called?
BC > BC > I’m using blitting because I don’t want to redraw the whole thing!
BC > BC > The button that I’m clicking does not over lap PtPanelGrou in any way.
BC > I did a little more research. It is the call to PtBlit that is
BC > damaging the widget. If I comment out the PtBlit() call then my draw
BC > function does not get called.
BC > What am I doing wrong?