Solved

Add an icon in top right

Posted on 1997-06-16
3
242 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 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

13 Experts available now in Live!

Get 1:1 Help Now