• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Drawing text on top of a progress bar
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Drawing text on top of a progress bar
      • From: Uli Kusterer <email@hidden>
    • Re: Drawing text on top of a progress bar
      • From: Damien Sorresso <email@hidden>
    • Re: Drawing text on top of a progress bar
      • From: Sherm Pendley <email@hidden>
  • Prev by Date: Re: Programmatically restarting Mac OS X
  • Next by Date: Preference Pane vs NSTimer/NSThread
  • Previous by thread: Humor in NSSavePanel
  • Next by thread: Re: Drawing text on top of a progress bar
  • Index(es):
    • Date
    • Thread