FROM : douglas a. welton
DATE : Wed Apr 02 19:59:19 2008
Gerriet,
Check out the documentation on User Interface Validation:
<http://developer.apple.com/documentation/Cocoa/Conceptual/UIValidation/UIValidation.html
>
This should get you going in the right direction.
Alternately, you can listen for the NSWindowDidUpdateNotification and
make the appropriate modifications to your button based on the state
of the keyboard.
regards,
douglas
On Apr 1, 2008, at 3:51 PM, Gerriet M. Denkmann wrote:
>
> On 1 Apr 2008, at 18:16, Jean-Daniel Dupas wrote:
>>
>> I dont think there is an automatic way to have it (except for menu
>> items), but you can have a look at the flagsChanged: method of
>> NSResponder.
>>
>> Le 1 avr. 08 à 17:24, Gerriet M. Denkmann a écrit :
>>> The FindPanel in TextEdit has in the bottom left corner a button
>>> "Replace All" which changes to "In Selection" when the ⌥-key is
>>> pressed.
>>>
>>> How is this done? I want to have such a changing button in some of
>>> my own panels.
>
> Well, I did have a look at the flagsChanged: method of NSResponder.
>
> My window has the following responder chain:
>
> <NSTextView: 0x6a04a0> // field editor of myTextField
> <_NSKeyboardFocusClipView: 0x6b5920>
> <NSTextField: 0x6866a0> // myTextField
> <NSView: 0x686ff0> // contentView
> <NSPanel: 0x6a23c0> // window
> (Mail.app did again eat all newlines when I pasted the text above.
> How can this be avoided? This kind of starts to get annoying.)
>
> Now the question: where to override flagsChanged: ?
> Or subclass NSPanel and override sendEvent ?
> Or put a subclass of NSResponder on top of the responder chain? How
> to keep it there (overriding makeFirstResponder in NSWindow?)
>
>
> Kind regards,
>
> Gerriet.
>
> _______________________________________________
>
> Cocoa-dev mailing list (<email_removed>)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>
> This email sent to <email_removed>
DATE : Wed Apr 02 19:59:19 2008
Gerriet,
Check out the documentation on User Interface Validation:
<http://developer.apple.com/documentation/Cocoa/Conceptual/UIValidation/UIValidation.html
>
This should get you going in the right direction.
Alternately, you can listen for the NSWindowDidUpdateNotification and
make the appropriate modifications to your button based on the state
of the keyboard.
regards,
douglas
On Apr 1, 2008, at 3:51 PM, Gerriet M. Denkmann wrote:
>
> On 1 Apr 2008, at 18:16, Jean-Daniel Dupas wrote:
>>
>> I dont think there is an automatic way to have it (except for menu
>> items), but you can have a look at the flagsChanged: method of
>> NSResponder.
>>
>> Le 1 avr. 08 à 17:24, Gerriet M. Denkmann a écrit :
>>> The FindPanel in TextEdit has in the bottom left corner a button
>>> "Replace All" which changes to "In Selection" when the ⌥-key is
>>> pressed.
>>>
>>> How is this done? I want to have such a changing button in some of
>>> my own panels.
>
> Well, I did have a look at the flagsChanged: method of NSResponder.
>
> My window has the following responder chain:
>
> <NSTextView: 0x6a04a0> // field editor of myTextField
> <_NSKeyboardFocusClipView: 0x6b5920>
> <NSTextField: 0x6866a0> // myTextField
> <NSView: 0x686ff0> // contentView
> <NSPanel: 0x6a23c0> // window
> (Mail.app did again eat all newlines when I pasted the text above.
> How can this be avoided? This kind of starts to get annoying.)
>
> Now the question: where to override flagsChanged: ?
> Or subclass NSPanel and override sendEvent ?
> Or put a subclass of NSResponder on top of the responder chain? How
> to keep it there (overriding makeFirstResponder in NSWindow?)
>
>
> Kind regards,
>
> Gerriet.
>
> _______________________________________________
>
> Cocoa-dev mailing list (<email_removed>)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>
> This email sent to <email_removed>
| Related mails | Author | Date |
|---|---|---|
| Gerriet M. Denkman… | Apr 1, 17:24 | |
| Jean-Daniel Dupas | Apr 1, 18:15 | |
| Jean-Daniel Dupas | Apr 1, 18:16 | |
| Gerriet M. Denkman… | Apr 1, 21:51 | |
| douglas a. welton | Apr 2, 19:59 | |
| Gerriet M. Denkman… | Apr 3, 10:44 | |
| douglas a. welton | Apr 3, 16:31 | |
| Gerriet M. Denkman… | Apr 4, 10:55 |






Cocoa mail archive

