David,
Thanks for taking the time to think about my question and test your proposed
solution. My problem is further complicated in that I am working with a
non-rectangular custom window set up with CreateCustomWindow. Also I have
not converted *yet* to using the Carbon Event Mgr, as I am still using
WaitNextEvent. So your suggestion of creating a nib window probably won't
work for me for my current project, as my understanding is that Carbon nib
resources require using the Carbon Event Mgr. Also I don't yet know how to
recreate a custom window as a nib. Perhaps I can study about how to use the
function you recommended, SetWindowContentColor, in a different way, but any
further suggestions are welcomed.
ECDixon
On 7/26/05 8:38 PM, in article
oster-19C3AC.20384726072005@newssvr14-ext.news.prodigy.com, "David Phillip
Oster" <oster@ieee.org> wrote:
>> Is there even a simpler, more direct way to resolve this?
>
[quoted text clipped - 5 lines]
> At least in 10.4, which is as much as I tested, things work correctly,
> and that is all you need to do.
David Phillip Oster - 27 Jul 2005 16:43 GMT
...
> My problem is further complicated in that I am working with a
> non-rectangular custom window set up with CreateCustomWindow. Also I have
[quoted text clipped - 5 lines]
> function you recommended, SetWindowContentColor, in a different way, but any
> further suggestions are welcomed.
Lookup SetControlColorProc(). It is specifically designed for passing in
a UPP to a pointer to a procedure for drawing the background array of a
control.

Signature
David Phillip Oster
Elliott Dixon - 30 Jul 2005 06:56 GMT
> Lookup SetControlColorProc(). It is specifically designed for passing in
> a UPP to a pointer to a procedure for drawing the background array of a
> control.
Thanks for the suggestion, David. That routine appears to be deprecated,
although it is still available (but not recommended). In the reference guide
for this API, under Carbon Porting Notes, it says "instead of specifying a
callback to redraw your background, you should make the background a control
and then embed your other controls within it". So I guess I'm back to
needing to set up a user pane and embed my pushbuttons within it. In either
case I'd have to write a routine at some stage to set the background color.
Do you, or anyone else reading this, know of any sample code, or willing to
provide me with the steps required, that would assist me in writing the
function to set the background color of such a user pane once I've created
it? I've found some info in K.J. Bricknell's book, "Carbon Programming", but
the section that discusses writing functions for a user pane assumes that
the reader is already well acquainted with how to go about writing such
functions, so he only provides the constants SetControlData() would require
(which in my case is kControlUserPaneBackgroundProcTag) once the function is
written. How do I define a user pane function that would simply set its
background color???? (I did see an API which I think was called
SetUpControlBackground(). I guess that at some point in my function I would
call this, but none of its parameters requires a color, so I'm still
confused.)
ECDixon
James W. Walker - 27 Jul 2005 17:18 GMT
> Also I have
> not converted *yet* to using the Carbon Event Mgr, as I am still using
> WaitNextEvent.
It is perfectly possible to use some Carbon Events in a program that
uses WaitNextEvent.
Elliott Dixon - 30 Jul 2005 06:58 GMT
> It is perfectly possible to use some Carbon Events in a program that
> uses WaitNextEvent.
Thanks for clarifying this, I'd always thought it was an either-or choice.
This new understanding will open up new possibilities for my app.
ECDixon