Drawing text on top of a progress bar
Drawing text on top of a progress bar
- Subject: Drawing text on top of a progress bar
- From: Derrick Bass <email@hidden>
- Date: Tue, 13 Jun 2006 20:38:04 -0500
I trying to create a custom view that displays text on top of a
progress bar (actually, displays a whole bunch of those next to one
another).
So in my init method, I allocate an NSProgressIndicator and an
NSTextField and I set the progress indicator to be a subview of my
custom view. I've read in the archives that overlapping views don't
work well, so I set the text field to be a subview of the progress
indicator. I've also set the text field's "setDrawsBackground" flag
to NO.
In my drawRect method, I setFrame the progress indicator and text
field and then I call drawRect for the progress indicator followed by
the text field. But whether the text or the progress bar comes out on
top seems arbitrary. Moreover, the text DOES draw the background, so
when it's on top it completely obscures the progress bar below it.
I can only assume that I am going about this totally wrong, but I
have no idea how to fix it.
Derrick
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden