Robert Craig <firstname.lastname@example.org> wrote:
I have an application that I’m porting to QNXRTP… It opens a number of
windows, each containing a raw widget, a few buttons, and a few numeric
floats… I’ve got two questions that I’d really appreciate answers
Firstly, how do I select which raw widget receives draw (Pg*) events? I
know that each raw widget has to have its own draw function (which it
does), but I’d like to be able to set up the raw widgets and change
multiple raw widgets without having to damage them to force a re-draw
(this has to do with the way the original code is set up… I really
don’t want to have to re-do it!).
I’m not getting a clear picture of what you’re trying to do here,
so correct me if I make a wrong assumption, OK?
The thing about PtRaw widgets in Photon is that they allow you an
arena in which you generate your own drawing (using the Pg*()
functions), which are turned into draw events by the library.
Receiving draw events is more the sort of thing done by the
graphics drivers, which turn them into whatever sort of voodoo is
appropriate to get pixels on your CRT.
If what you’re after is a way for you to generate new drawings
inside the PtRaw widgets, then you should consider working with
whatever is triggering the change. If you’re getting periodic
timing from a PtTimer, it has a callback that you can use to poke
the appropriate PtRaw. Using a system timer via pulse and input
function? Same sort of deal. Hardware driven via a file
descriptor interface? Look at the docs for PtAppAddFd().
Secondly, I’ve noticed that when moving a window over (only) the buttons
/ numerics, they automatically repair themselves. However, when I move
a window over both the buttons (or numerics) AND the raw widget, the
buttons / numerics aren’t re-drawn.
Odd – does the raw widget overlap the other sort? Where are
they in the widget hierarchy? Which is closest to the user, the
button/numeric or the raw? (NB, the lower the widget is on the
widget hierarchy, the closer it is to the user.)
I can include a “PtDrawWidget” call
in the raw draw function, but I was wondering if this was normal
behaviour (I do a PtSuperClassDraw within the raw drawing function as
Hmmm. I’ve normally seen only Pg*() functions used, but I’ve
never done anything particularly dramatic. Mind you, I can’t
find PtDrawWidget() doc’ed in the 2.0 Photon library reference
anywhere. It doesn’t seem to be in the 1.14 docs, either.
I hope this is some help, at least…
QSSL Training Services