f



How to set Action for First Responder?

Hi, I have a Cocoa Document-based application, and I edited the 
main menu (added a new entry).  Now I'd like the new menu entry to 
invoke the action newUser: in the responder chain (actually, I 
want it to be sent to the current key-window MyDocument instance, 
but the responder chain should work for that).

I added the action as IBAction to MyDocument.h and dragged it into 
Interface Builder.  When I now try to set the action for the menu 
entry with target FirstResponder, my action doesn't show up :(

Is there any way to set an arbitrary action in Interface Builder? 
  If not, how do I set the action for a menu item (yes, I could 
look that up I guess), and most of all, *where* would I put that 
init code?

-- 
By claiming a patent [...], I'm saying that you are not permitted 
to use your own knowledge to further your ends. By what right?
	Roderick T. Long
0
Ulrich
7/8/2005 4:11:48 PM
comp.sys.mac.programmer.help 4653 articles. 2 followers. Post Follow

2 Replies
1983 Views

Similar Articles

[PageSpeed] 19

In article <3j7mu5Fos6ihU1@individual.net>,
 Ulrich Hobelmann <u.hobelmann@web.de> wrote:

> Hi, I have a Cocoa Document-based application, and I edited the 
> main menu (added a new entry).  Now I'd like the new menu entry to 
> invoke the action newUser: in the responder chain (actually, I 
> want it to be sent to the current key-window MyDocument instance, 
> but the responder chain should work for that).
> 
> I added the action as IBAction to MyDocument.h and dragged it into 
> Interface Builder.  When I now try to set the action for the menu 
> entry with target FirstResponder, my action doesn't show up :(
> 
> Is there any way to set an arbitrary action in Interface Builder? 
>   If not, how do I set the action for a menu item (yes, I could 
> look that up I guess), and most of all, *where* would I put that 
> init code?

Yes. Select the First Responder "numeral one" instance. Then switch the 
current pane of that window to "Classes". The class "First Responder" 
should be selected. If it isn't, select it. Then, use the Contextual 
menu by <Control>Clicking on "First Responder". Choose "Add Action". 
That will bring up the actions inspector, and let you add arbitrary 
actions. Then, connect the menu item to the first responder the usual 
way.

At runtime, the app will do a 

[NSApp sendAction: @selector(mymenuCommand:) to: nil sender: 
<the--menu-item>];

which will walk the responder chain looking for the first object that 
can handle that selector.

People usually keep their entire menu bar in their main nib, separate 
from their document's nib, and just let the fact that the current 
document is in the responder chain handle it.

-- 
David Phillip Oster
0
David
7/8/2005 4:19:25 PM
David Phillip Oster wrote:
> Yes. Select the First Responder "numeral one" instance. Then switch the 
> current pane of that window to "Classes". The class "First Responder" 
> should be selected. If it isn't, select it. Then, use the Contextual 
> menu by <Control>Clicking on "First Responder". Choose "Add Action". 
> That will bring up the actions inspector, and let you add arbitrary 
> actions. Then, connect the menu item to the first responder the usual 
> way.

Thanks, that worked.  I didn't know FirstResponder had its own 
class entry, funny that.

-- 
By claiming a patent [...], I'm saying that you are not permitted 
to use your own knowledge to further your ends. By what right?
	Roderick T. Long
0
Ulrich
7/8/2005 4:43:23 PM
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...

FCC Takes First Step to Help Revolutionize America's 9-1-1 Services for Consumers, First Responders. [telecom]
December 21, 2010 FCC Takes First Step to Help Revolutionize America's 9-1-1 Services for Consumers, First Responders. Rapid Sharing of Videos, Photos and Data to Improve Emergency Response Washington, D.C. --The Federal Communications Commission today took an important step to revolutionize America's 9-1-1 services for consumers and first responders by adopting a Notice of Inquiry (NOI) seeking public comment on how Next Generation 911 (NG911) can enable the public to obtain emergency assistance by means of advanced communications technologies beyond traditional voice-...

help changing first responder
NSTextField is really kicking my ass... :-) If the user edits a text field and the value is invalid, I want to pop up an alert, restore the previous value, and keep the field as first responder. I can do the first two just fine in the text field action, but I can't figure out how to stop first responder from changing. First I tried makeFirstResponder. Then I figured the text field action is being sent before the event that caused it (tab, for example) is being processed, so I tried flushBufferedKeyEvents but that didn't work either (and anyway that wouldn't work ...

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...

help setting up first openvpn
Hello, Can anyone assist with setting up my first openvpn? I've read the docs, howtos, and books, but something basic isn't connecting. I've got the openvpn setup on a centos 5.1 box, and remote clients can connect to it which tells me my firewalls shouldn't be an issue, but they can't do anything else, not pinging, not mounting samba shares. I've got keys and can meet on aim or irc if anyone has done this and can help i'd appreciate it. Thanks. Dave. "Dave" <dmehler26@woh.rr.com> writes: >Hello, > Can anyone assist with se...

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...

HELP Watchmaker crashes on first action!
I got watchmaker for Xmas, when loaded onto my XP machine ok, intro movie runs fine up to the part where two characters are stood in the corridor. When I go to the lift with either character and press the lift button the game exits and goes to desktop. I've tried different graphics settings to no avail. I have put a query on gmxmedia web site but no reply as yet. My machine is an Athlon XP 1800+ processor and Nvidia geforce2 MX/MX 400 graphics card. I'll be grateful for any help to cure this problem. Thanks. Mick Mick Sample wrote: > I got watchmaker for Xmas, when ...

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...

My first SYS-RPL program
Hi, I'm beginner in SYSRPL and have a problem with the following simple program on the 50g :: DUP %* SWAPDUP %* %+ %SQRT; I give one, eg 2:5, 1:6 then I get the absurd result 993646.325695. Even the multiplication of 6 * 6 is garbage. am grateful for any help Greetings Klaus Sounds like you have integers on the stack when your program requires reals. Approx Mode should work. You may want to look into argument checking (Chapter 29 in "Programming in System RPL") to ensure the correct number and type of argument(s) exists. Jacob On 30/10/2010 8:54 AM, Klaus wrote: > Hi...

HELP setting up Mac & PC emulations
It's been a long time since I've done this and may need your guidance and recommendations. I just installed a 150GB drive in my A1200T. The system has a 50MHz 68060 with 256MB, SCSI-II & Ethernet. I want to install Fusion 68k with the latest version of the MacOS (68k), I think that's 8.x. I also want to install Windoze95 with PCTask4. I know that it's VERY slow but it does work, I did it once before on my A3KT/060. Firstly, is there anything special I need to do when setting up the harddrive partitions? What filesystem should be installed? I want to us...

Need help setting up kerberos for the first time
Hi everyone, I am new to Kerberos and having some trouble setting it up. Here are the steps that I took: a) Edited /etc/krb5.conf: [libdefaults] default_realm = USDSTORAGE.COM krb4_config = /usr/kerberos/lib/krb.conf krb4_realms = /usr/kerberos/lib/krb.realms [realms] USSTORAGE.COM = { admin_server = USDSTORAGE.COM default_domain = USDSTORAGE.COM kdc = USDSTORAGE.COM } [domain_realm] .usdstorage.com = USDSTORAGE.COM usdstorage.com = USDSTORAGE.COM b) mkdir /var/lib/krb5kdc c) Edit /et...

dynamically setting form action
I'm relatively new to javascript. OK, I'm not very adept at it. Here's what I'm trying to do: 1. User wants to request a document, MyFileName.pdf. User clicks on link. Link has a parameter set with it, something like?ID=MyFileName (../resources/resource-center.html?ID=MyFileName). Link takes user to form request-form.html he needs to fill out to get to the document he has requested. 2. Upon submit, user is taken to document he originally wanted, for example MyFileName.pdf, and the form data posts to a file that is submitted to me. I've been all over cyberspace and beyond ...

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 ...

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
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!!!
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 ...

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...

Need help setting up my first cable connection
I was wondering if there are any suggestions what settings need to be set on a cable modem. My ISP came in and plugged in a modem and basicly checked to be sure it installed itself on XP as it did and he left. I'm searching new websites to read up on this technology but in the mean time is there "ANY" settings that I can or should quickly make to tweak this connection? I check the connection rate off and on @ some different websites and it ranges from 475 to 715 but averages in the high 600s. [This followup was posted to comp.dcom.modems.cable and a copy was sent to...

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...
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
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 ...

Web resources about - How to set Action for First Responder? - comp.sys.mac.programmer.help

First-Responder Alliance Inc.
This website will help introduce you to our flagship application, First-Responder (Fire Edition), the first in a suite of open-source applications ...

First responder - Wikipedia, the free encyclopedia
A first responder is an employee of an emergency service who is likely to be among the first people to arrive at and assist at the scene of an ...

911 Toolkit for Emergency Responders on the App Store on iTunes
Get 911 Toolkit for Emergency Responders on the App Store. See screenshots and ratings, and read customer reviews.

The future of firefighting - A HMD-AR UI concept for first responders - YouTube
Headmounted display (HMD) Augmented Reality (AR) technology is only a few short years away and the Department of Homeland Security is actively ...

Syria first responders remind UN of humanitarian catastrophe
Raed Saleh has traveled to the United Nations seeking funding to save lives in Syria even as money for the humanitarian crisis declines, writes ...

Cole Miller death: First responders plan prayer vigil
A vigil will be held on Monday night for Cole Miller, the teenager who died following an alleged king hit in Fortitude Valley on Sunday morning, ...

Roadside responder to Canberra crash says more people need to learn first aid
... few investments you'll make as valuable as one in a first aid certificate, Brad Lovelock says. The public servant was one of the first responders ...

Father of Depot Beach cliff fall victim wants to thank first responders
The photo on top of the cliff shows Lachy Shaw beaming, minutes later it was a starker image.

Man crushed by car thanks volunteer Queensland Ambulance first responders
Man crushed by car thanks volunteer first responders.

Parliament Hill shooting responders hit with communications problems as cellphone networks jammed
Internal documents show Ottawa officials were concerned about how a spike in cellphone traffic immediately following the Oct. 22 Parliament Hill ...

Resources last updated: 2/19/2016 11:17:25 PM