Path: utzoo!attcan!uunet!samsung!rex!wuarchive!psuvax1!xavier!jackiw From: jackiw@cs.swarthmore.edu (Nick Jackiw) Newsgroups: comp.sys.mac.programmer Subject: Re: Password Dialogs--what is the best way to do them? Message-ID: Date: 7 Jul 90 17:13:28 GMT References: <36805@shemp.CS.UCLA.EDU> Sender: news@xavier.swarthmore.edu (Usenet News) Reply-To: jackiw@cs.swarthmore.edu (Nick Jackiw) Organization: Visual Geometry Project, Swarthmore College, PA Lines: 25 tj@cs.ucla.edu (Tom Johnson) writes: > My big question is: How do I know when the user is entering text into > the Password text edit item (as opposed to the UserName item)? The event > record gives me no indication of which item is selected (or does it?), > the itemHit variable doesn't tell me, and I don't where to find out. There's a field in the DialogRecord called editField, which according to I-408 "is one less than the item number of the current editText item, or -1 if there's no editText item in the dialog." So use this and bob's your uncle. Do beware of tabs, though. ModalDialog interprets these separately, as keys to switch from the current editText item to the next. This switching probably happens after your filterProc and before your itemHit. Make sure you ignore tabs, or handle them appropriately. > Tom Johnson UCLA Computer Science Department -- -----Nicholas Jackiw [jackiw@cs.swarthmore.edu|jackiw@swarthmr.bitnet]----- "Here is how I built this artificial mine. I snatched a female louse from the hair of humanity. I was seen to lie with her on three successive nights, and then I flung her into the pit." _Maldoror_, Canto II