Re: Drawing text on top of a progress bar
Re: Drawing text on top of a progress bar
- Subject: Re: Drawing text on top of a progress bar
- From: Damien Sorresso <email@hidden>
- Date: Tue, 13 Jun 2006 23:54:00 -0500
On 13 Jun, 2006, at 8:38 PM, Derrick Bass wrote:
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.
You might, if you're going to have a bunch of those, consider giving
the custom view its own NIB. When you lay out the view, just put the
text on top of the progress bar and connect the two outlets as your
normally would.
--
Damien Sorresso
Macintosh Developer
Computer Infrastructure Support Services
Illinois State University
E-mail: email@hidden
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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