f



menu basics

I'm having a lot of trouble figuring out how to make my application 
react to menu items.  All the documents I've seen seem to assume this 
is so simple and obvious that it requires no explanation -- but I'm 
completely lost!  I can easily add a menu item in IB, but can't figure 
out how to set its "target" or get my program to receive some kind of 
event message from it.

-- 
Tony Belding, Hamilton Texas

0
Tony
2/15/2007 12:56:09 AM
comp.sys.mac.programmer.help 4653 articles. 2 followers. Post Follow

4 Replies
208 Views

Similar Articles

[PageSpeed] 13

In article <2007021418560916807-zobeid@techiecom>,
 Tony Belding <zobeid@techie.com> wrote:

> I'm having a lot of trouble figuring out how to make my application 
> react to menu items.  All the documents I've seen seem to assume this 
> is so simple and obvious that it requires no explanation -- but I'm 
> completely lost!  I can easily add a menu item in IB, but can't figure 
> out how to set its "target" or get my program to receive some kind of 
> event message from it.

It's done the same way you set any other kind of target in IB-- 
control-drag from the menu item to the target object, and then use the 
inspector to choose the target method on that object.

-- 
Tom "Tom" Harrington
MondoMouse makes your mouse mightier
See http://www.atomicbird.com/mondomouse/
0
Tom
2/15/2007 1:05:51 AM
Tony Belding <zobeid@techie.com> wrote:

> I'm having a lot of trouble figuring out how to make my application 
> react to menu items.  All the documents I've seen seem to assume this
> is so simple and obvious that it requires no explanation -- but I'm 
> completely lost!  I can easily add a menu item in IB, but can't figure
> out how to set its "target" or get my program to receive some kind of
> event message from it.

The best thing you can do is work through this tutorial:

<http://developer.apple.com/documentation/Cocoa/Conceptual/ObjCTutorial/
index.html>

patrick
0
noreply
2/15/2007 1:09:11 AM
On 2007-02-14 19:05:51 -0600, Tom Harrington 
<tph@pcisys.no.spam.dammit.net> said:

> It's done the same way you set any other kind of target in IB--
> control-drag from the menu item to the target object, and then use the
> inspector to choose the target method on that object.

I don't get it?  In a document-based app, the menu items are all in 
MainMenu.nib, but all my other objects are in MyDocument.nib.  I can't 
make a connection to something in a different nib file.

-- 
Tony Belding, Hamilton Texas

0
Tony
2/15/2007 3:31:55 AM
Tony Belding <zobeid@techie.com> wrote:
> On 2007-02-14 19:05:51 -0600, Tom Harrington 
> <tph@pcisys.no.spam.dammit.net> said:
> 
>> It's done the same way you set any other kind of target in IB--
>> control-drag from the menu item to the target object, and then use the
>> inspector to choose the target method on that object.
> 
> I don't get it?  In a document-based app, the menu items are all in 
> MainMenu.nib, but all my other objects are in MyDocument.nib.  I can't 
> make a connection to something in a different nib file.

It will be handy for you to learn about the responder chain:

http://developer.apple.com/documentation/Cocoa/Conceptual/EventOverview/EventArchitecture/chapter_2_section_6.html

Long story short, for this particular task, create a new action on the 
FirstResponder pseudo-class, and then connect the menu item to the First 
Responder object in your nib. Then in your NSDocument or 
NSWindowController subclass, custom focusable view, or other entity that 
can get into the responder chain, implement an action with that same name. 
Cocoa will do the Right Thing and find your action when that document is 
frontmost.

But really, read up on this whole responder chain business. It's used for 
a lot of other things as well, and as such is very important to know.

-- 
Michael Ash
Rogue Amoeba Software
0
Michael
2/15/2007 3:35:09 AM
Reply:

Similar Artilces:

No Mac Help in Mac Help?
When I go to Mac Help in Finder (latest version of OSX Tiger) I get nothing. The window pops up but it's blank. Click on the little house and the initial screen fills in but nothing beyond that. I had a simiar problem with Safari help some time back and someone suggested I remove a folder from Library/Caches, (com.apple.helpui or something similar) and that did the trick for Safari's help. I honestly don't recall if I've ever had the Mac Help or I've just never used it since this machine. The problem happens on or offline so I'm not sure where the Mac Help file re...

Help! iSync mac to mac
Am I right in saying that with iSync, if you want to sync 2 macs together (address book, iCal etc.) the only way to do this is via a ..Mac account, even if those computers are sitting not 5 feet from each other, both Airport equipped? If this is the case, I've never heard anything so ridiculous. Is this just part of another apple scam to get more money out of us? Does anyone know if this is indeed the case, and can you recommend any other sync software out there? I'm setting up an iMac, eMac and powerbook g4 for a friend's office, all running OSX Panther, and you'd think basi...

Help Help Help Help Help
please,help us . we have a seious problem, we are designing a radio controlled car that is guided by the PC, to send the data wireless between the PC and the Car and vice versa. we use 2 transmitter/reciever circuits from 2 seperate radio controlled car each running with a different frequency (27 MHz & 40 MHz)and modify the functionality of each to do the disered work. but on mounting a transmitter(40MHz) and reciever(27MHz) on the car, and attach another transmitter(27MHz) and reciever(40MHz) to the PC; we found that on sending signals from the car to the PC on the transmitter & rec...

help!help!help!help!
I am a student.I am going to make a simulation of a robot (FANUC Robot M-16iB) under the matlab\simulink environment . It is a normal 6DOF robot.I want to realize any angle and any speed (under the max speed) and any position and orientation control. As I just starting to do this new field,I have no experience about it. Can you give me some simulation demo or examples for 6DOF robot? I am very eager to get these.Please write back to me as soon as possible,thank you! Sincerely, Connie&#12288;&#12288;&#12288;&#12288;&#12288;&#12288;&#12288; zhanglijuan920@sohu.c...

More SWI / BASIC SYS Help!
Hi guys, not being one to stick to one thing :@P I have a slight issue in BASIC again! using the module DiskSample and command SYS "DiskSample_StreamParam",streamhandle%,fetch% TO result$ I get result$ to = ofla in the documentation it states : 5 - R2 = author, pointer to a 0 terminated string. obviously I have done a bit of research in my Arthur dated BBC Basic guide / Strong help manual (BASIC) and cannot work out how I am to get access to the string.. Can someone point out my [very] simple mistake :@) I will continue to look as well Cheers again you very helpful lot! ...

Help! I've Been Forced To Use A Mac, Online Help for Mac?
http://www.suggestafix.com/index.php?showtopic=33751 Help! I've Been Forced To Use A Mac, Online Help for Mac? Aug 29 2009, 12:23 PM Post #1 Group: Star Member Posts: 297 Joined: 31-May 06 Member No.: 14,025 Today, for a hopefully brief period of time, I'm being forced to use a Mac. Since these machines are incomprehensible, I need a simple piece of information*. I know this is heresy, but . . er . . is there anywhere on the Net where peeps answer questions without offering them the choice of (1) $15 (2) $25 or (3) $50 for the answer. ~ beau (but don't tell anyone I asked...

Tkinter: populating Mac Help menu?
Hello all, Creating a 'Help' menu 'by hand' on the Mac does not work, or rather, it creates a *second* Help menu. There are hints about how to do this at: http://tkinter.unpythonic.net/wiki/Widgets/Menu but so far those hints have not been enough :-) The following statements are the result of several happy hours experimenting with dir(obj) for several objects obj related to menus. (Jeeze, I love Python, but you knew that :-) The url above suggests that the 'official' Mac menu is named x.help, where x is the Tk name (a string) of the menubar. If menu...

Where to look for help (confessions of a mac/unix programmer)
I need a tutorial... I'm a mac/unix guy looking into programming windows for the first time. I have the Petzold book. I've downloaded tools from MS, in the form of Microsoft Platform SDK for Windows XP SP2 (i'm using sp2) Microsoft Visual C++ Toolkit I've edited environment variables (PATH, INCLUDE, and LIB)in the C++ Toolkit file vcvars32.bat to point at the appropriate directories in the SDK. Now, I start a shell using "Visual C++ Toolkit Command Prompt", and use cl to compile my simple file (which contains the first Petzold example). First,...

Help Help Help
Hello, I am a reluctant user of the website ntsearch.com. I accidentally download a Java program called "dict" from an ebook website to my XP and now every English words that I read from my computer has got a link with your web. I found it very frustrating when I noticed all the chinese characters I read from the web now become loads of question marks. I think it has a link with the program that I accidentally downloaded from that ebook website. How can I remove the so called "dict" program and other Java Scripts from my computer? This is very urgent and please answer my ...

MAC RS232 / USB programmer help needed
Hi, I'd like to colaborate with a MAC programmer to port an application I'm writting onto a MAC platform. The application's engine is all ANSI C and the GUI is in QT, so those parts should work fine on Windows, Linux and Mac. However, the program needs to interface with the serial ports (RS232 and USB). I'm a linux guy myself, and even though MAC looks to be based on freeBSD, I dont feel confidant to write that part of code myself (that and the fact I dont own a Mac). The interface code is very simple and would consist of 3 API's. A setup API, "get...

HELP HELP HELP...
Hi everybody there. I have created a GUI in MATLAB's guide application. In the GUI I am appearing on the screen a frame from a camera by pushing a button. My problem that sometimes the application works fine, but some others something is going wrong and I get the following error message: ??? Assignment has more non-singleton rhs dimensions than non-singleton subscripts Error in ==> LEDsFinal>txtGrabFrame_Callback at 164 A(width, i, Blue) = abs(fread(portCMU, 1, 'uint8'))/255; What does the error message mean? What seems to be the problem? How can I overco...

Help, Help, Help...
Hei! Im makin a hot INVADERS game with Java but im a newbie with language, so , question is how do i use KeyPressed () function... I hav Applet Runnable... -!Hei!- Here is my problem... public class TestinKeys extends Applet implements Runnable .... .... public void run () { while ( true ) { KeyEvent ke; if ( ke.getKeyChar() == 'a' ) g_TykkiX ++; .... .... What is Wrong, im tryin to make that Invaders game but i dont know how to read keyboard with Runnable Java code... JariTapio <JariTapio@pp.inet.fi> wrote: > publi...

Help Help Help
Q1 I want to know how to show the 8 bit planes of the image?? Q2 And also find edges of image by showing both edge magnitude and direction?? ...

HELP! HELP! HELP
I hope someone out there can solve my mysterious problem. I have tried everything imaginable, even paid $35 to Microsoft to help me, but they were not able to figure out this problem: Here is the problem: I recently created a new database in Access 2002. I took data from an > access 97 database converted one of the tables to access 2002 and then > imported it into a new table in access 2002. but for some strange > reason, every once in a while the data changes to Japanese characters, > it only happens once in a while, but once it happens that record is > lost. i have tried...

HELP-HELP-HELP!!!!!!!!!!
On this site par example: http://communications.siemens.com/cds/frontdoor/0,2241,nl_nl_0_27443_rArNrNrNrN,00.html u have a 3d animation, like many other sites...but if i want to see this a new window opens and i see a icon with ared cross in it. also on sites with games i see this... What is my problem? I have winXP-Pro firewall is out and sec. is on low..... twan1@home.nl (Twan) writes: > On this site par example: > http://communications.siemens.com/cds/frontdoor/0,2241,nl_nl_0_27443_rArNrNrNrN,00.html > u have a 3d animation, like many other sites...but if i want to...

Help!! Help!! Help!!
I wish to vectorize the following code: s = tf('s'); W = logspace(-1,2,50); COMBINATION = combn(W, 2); K = cell(length(COMBINATION), 1); K0 = 1 + (1/(2*s)) + 0.5*s/(0.2*s + 1); % PID controller to be approximated as PI gapValue = zeros(length(COMBINATION), 1); for i = 1:length(COMBINATION) K{i} = (COMBINATION(i,1)*(1 + (1/(COMBINATION(i,2)*s)))); % PI controller end for i = 1:length(COMBINATION) gapValue(i,1) = gapmetric(K0, K{i}); end where K0 is the Nominal transfer function and K is a cell array including transfer functions whose gap metric from K0 are...

Help, Help, Help
As you can probably gather im in need of help. I started a basic JAVA course a week ago as it seems like a very interesting subject. The problem in having is with the IDE we have been asked to use. We are using JCreator, but in order for it to work, we are required to install the Java software development kit and a class library which comes with the course book called avi with is a audio visual interface library which is supposed to make it easier for us to learn the fundimentals of JAVA without having to worry about the input/output. Anyways, I have installed the JAVA SDK from SUN website...

HELP! HELP! HELP!
We are currently running R83 v3.1m (33 user) on an old 200 Mhz Pentium with 16Mb Mem and 2.x gif HD (the actual partition is smaller) We have run this for a number of years without ANY significant problems. Last week (just as my family was in the middle of "the move from Hell") the system decides to take a major dump. A bad link of some sort in the ABS area. THEN - the systems disks have disappeared. After much screaming and gnashing of teeth I got the system running again. OH! did I mention that the previous evenings file save tape was bad? Anyhow, the bo...

Help menu item on Mac OS X
Hi Mac using folk. A bit of feedback I've received recently is that my 'Help > Appname Help' menu item exists but doesn't do anything. It's the one which is, by default, associated with the Meta-? accelerator. Setting the menu item for 'Appname > Preferences' involved the creation of a proc as follows: proc ::tk::mac::ShowPreferences {} { SomePrefsProc } I assume setting that Help menu item involves a similar procedure, but, I can't find the proc name which needs to be defined documented anywhere. Can anyone assist? (Even better, is there a page wit...

help with css menu in ie6 and mac browsers
I'm wondering if anyone has access to ie6 and can view my css and see if they can help me . As it stands, my menu looks different in both mac browsers and IE6. At this point, I haven't tested in IE7. Keeping my fingers crossed for now! What I need the menu is to look like is the menu on this page (with all the same hover background colors, margins and text colors): http://www.gseis.ucla.edu/~edd/www/_saba/index.html The page I need to fix it this one: http://www.gseis.ucla.edu/~edd/www/_saba/adxmenu_elp.html As you can see, background colors and margins are messed up as I...

Invoking HELP from help menu
I have a created my own menu for my LabVIEW application in which HELP is also one of the items. I want help to be displayed upon clicking the HELP menu item. I created a .rtf file and compiled it to get .hlp file. I don't know how to display the help when the user clicks the HELP menu item. Can anyone help me? An example would be of breat help. Thanx, Srini. Hi, There is a "Control Online Help" function in "functions>application control>help". Use an event structure to catch the menu item selection. Regards, Wiebe. "srini" <x@no.email> wrote...

HELP HELP HELP
Hello everyone, I am a freshmen at a computer university and also new to C++ . I havent used C before either but been through PASCAL and GW-BASIC. Can someone please tell me the link to download the C++ compiler which can run on my Windows XP Professional Edition. Thanks. ByE. Yours forever in Digital Paradise uSmAn could have typed what u wanted in google. "Usman" <game_pk@hotmail.com> wrote in message news:buobgo$kaacm$1@ID-217624.news.uni-berlin.de... > Hello everyone, > I am a freshmen at a computer university and also new to C++ . I havent used > C before eit...

HELP HELP HELP
Hi! All, I am an Interactive Media Designer and know very less about asp but the basic concept behind. I got to make an online test(Exam) in asp which has a login (frm access database) panel. Can any one direct me to a free source so that I can simply pick the project and customize it. Thnaks in Advance Raj.Design In article <1112007306.454441.207430@f14g2000cwb.googlegroups.com>, raj.design@gmail.com enlightened us with... > Hi! All, > I am an Interactive Media Designer and know very less about asp but the > basic concept behind. I got to make an online te...

help! help!! help!!! me
hello if x=linspace(1,100,n); p=linspace(100,80,n-1); how can I get A A=[ x(1) 1 0 0 0 0 0 0...0 0; x(2) 1 -x(2) -1 0 0 0 0...0 0; p(1) 0 -p(2) 0 0 0 0 0...0 0; 0 0 x(3) 1 -x(3) -1 0 0...0 0; 0 0 p(2) 0 -p(3) 0 0 0...0 0; 0 0 0 0 x(4) 1 -x(4) -1...0 0; 0 0 0 0 p(3) 0 -p(4) 0...0 0; ....................................... 0 0 0 0 0 0...x(i) 1 -x(i) -1...0 0; 0 0 0 0 0 0...p(i-1) 0 -p(i-1) 0 ...0 0; ......................................... 0 0 0 0 0 0....x(n-1) 1 -x(n-1) -1; 0 0 0 0 0 0....p(n-2) 0 -p(n-1) 0; 0 0 0 0 0 0.... 0 0 p(n-1) 0; ] "Jim lei" <redlightlike@mathworks.c...

help! help!! help!!!
x=[0 1 10] p=[100 80] how can I get A A=[3x(1) 2x(1) x(1) 1 0 0 0 0; 2x(1) x(1) 1 0 0 0 0 0; 3x(2) 2x(2) x(2) 1 -3x(2) -2x(2) -x(2) -1; 2x(2) x(2) 1 0 -2x(2) -x(2) -1 0; p(1)x(1) p(1) 0 0 -p(2)x(2) -p(2) 0 0; p(1) 0 0 0 -p(2) 0 0 0; 0 0 0 0 -p(2)x(3) -p(2) 0 0; 0 0 0 0 -p(3) 0 0 0; ] In article <fkus3t$11h$1@fred.mathworks.com>, Jim lei <redlightlike@mathworks.com> wrote: >x=[0 1 10] >p=[100 80] >how can I get ...

Web resources about - menu basics - comp.sys.mac.programmer.help

STOS BASIC - Wikipedia, the free encyclopedia
STOS BASIC is a dialect of the BASIC programming language implemented on the Atari ST computer. STOS BASIC was originally developed by Jawx , ...

Universal basic income debate in Australia
TAX reform has taken centre stage in Australian politics at the moment, and in the background a radical idea is quietly gaining momentum.

New Net Neutrality Rules in India Strike Down Internet.org’s Free Basics
... in India . Reuters reported that the country put net neutrality rules into effect Monday that would seem to spell the end for the Free Basics ...

India's relationship with Facebook and Free Basics
Regulators deal blow to Facebook's project aiming to bring free basic internet services to phone users in India. What has happened? Regulators ...

Mark Zuckerberg is 'disappointed' at India Free Basics ban and vows to fight on
Facebook was dealt a blow today when its Free Basics program was banned in India for contravening net neutrality rules. As you would expect, ...

Facebook withdraws Free Basics from India after regulatory debacle
Facebook has withdrawn Free Basics from India, days after the country's telecommunications regulator prohibited the differential pricing of data ...

John Kasich campaigns like a moderate, but on women's health he's your basic Republican nightmare
John Kasich has positioned himself in the Republican presidential primary as the … maybe not quite moderate guy, but ...

Why Facebook's Free Basics Internet Service Stirs Up Controversy
Facebook, through its Free Basics platform, hopes to bring the Internet to people in emerging markets. But not all countries are on board. Here's ...

Mark Zuckerberg Responds To India's Decision To Ban Free Basics
On Monday, Indian regulators ruled to ban Facebook's Free Basics Internet service—but Zuckerberg says that won't keep Facebook out of India. ...

Marc Andreessen Unwittingly Likens Facebook Free Basics To Colonialism, Kicks Up India Twitter Storm
... and Silicon Valley luminary Marc Andreessen kicked up an internet storm and offended many Indians when he lashed out at Facebook Free Basics ...

Resources last updated: 2/17/2016 8:14:03 PM