Solved

Add an icon in top right

Posted on 1997-06-16
3
248 Views
Last Modified: 2013-12-26
Where can I find documentation/sample source code on what to use if I want to add an icon in the top right of the screen, that is always present (like the Balloon Help icon). Also, is it possible to change this icon after initial initialization? I'm trying to create an app that'll use such an icon to indicate the status of a running daemon.
0
Comment
Question by:drz
3 Comments
 
LVL 1

Accepted Solution

by:
PAD earned 150 total points
ID: 1291503
Warning the feature you describe do not seems to match the Apple Interface Guideline.
An application is not allowed to add an icon in menu bar.
The icon that are present are handle by extension not application and are menus not icon.

To find sample go the apple developper web site and look for adding icon-menu in sample codes and snippets

http://devworld.apple.com/dev/techsupport/source/index.html

on this site you will also find all apple documentation in the InsideMac section

Hope this will help you

0
 
LVL 1

Expert Comment

by:atlas
ID: 1291504
Apple very kindly provide the Notification manger routines to do just this task. You are limited to using the Apple menu or Finder (read Application) menu, but it suffices the most users.
The following example is taken from Think Reference and displays an alert and flashes the icon (changes the code as per your needs).
/* CODE EXAMPLE #1 */
// How to set up a notification record.

      NMRec      myNotification;      //a notification record
      short      myResNum;      //resource ID of small icon resource
      Handle      myResHand;      //handle to small icon resource
      Str255      myText = "\pSample Alert Box";
                                                                  //string to print in alert box

      myResNum = 1234;            //resource ID in resource fork
      myResHand = GetResource('SICN', myResNum);
                                                                  //get small icon from resource fork

      myNotification.qType = nmType;      //set queue type
      myNotification.nmMark = 1;      //put mark in Application menu
      myNotification.nmIcon = myResHand;//alternating icon
      myNotification.nmSound = (Handle)-1;      //play system alert
                                                                              // sound
      myNotification.nmStr = myText;      //display alert box
      myNotification.nmResp = nil;      //no response procedure
      myNotification.nmRefCon = 0;                  //not needed


0
 
LVL 1

Author Comment

by:drz
ID: 1291505
PAD,
I don't think you entirely understand my question. I want the icon there when my application is not in the foreground. atlas' answer was great though, very helpful. (Sorry, can't give you the points.)

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
cat dog challenge 18 124
repeateFront java challenge 31 92
withoutTen challenge 14 97
"Black Box" Testing of Control System Software 2 17
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now