how do i get a badged app icon?
how do i get a badged app icon?
- Subject: how do i get a badged app icon?
- From: Ken Victor <email@hidden>
- Date: Sat, 16 Oct 2004 16:22:00 -0700
Title: how do i get a badged app
icon?
under some circumstances, i need to display an app modal critical
alert. this alert needs to have more than just a title and a message
as it needs to include a picture.
currently, i have this working as described below, but it seems
to me that there is probably a much more direct and better
approach.
current approach"
using IB, i've defined a nib file that among other views,
contains an NSImageView currently set to hold
NSApplicationIcon.
when needed, i:
1) create a NSNib
2) instantiate the nib
3) enumerate over the top array (created when nib
instantiated) to find the window/panel
4) find my NSImageView in this panel (via viewWithTag to
the contentview of my panel)
5) create a critical alert panel via
NSGetCriticalAlertPanel
6) find the badged icon in the critical alert (ie, scan
the subviews of the panels content view looking for a NSImageView and
then getting its image)
7) set the image of my own image view to the one i found
in the alert panel
8) "run" my alert via NSApp
runModalForWindow
9) appropriate cleanup when done
this works fine, but seems overly complex to me. what is the more
accepted way of accomplishing this?
thanx,
ken
_______________________________________________
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