Re: NSTextField undo in a sheet?
Re: NSTextField undo in a sheet?
- Subject: Re: NSTextField undo in a sheet?
- From: Ken Victor <email@hidden>
- Date: Fri, 9 Dec 2005 16:15:49 -0800
i got them to work in my app by providing support for the sheet in
its owner/parent window. in the parent window, i provide:
validateMenuItem
undo
redo
in each of these 3 methods, i check to see if i have an attached
sheet, and if so, simply call the corresponding method (if it exists)
in the sheet.
ken
At Fri, 9 Dec 2005 19:02:25 -0500, Jim Correia wrote:
On Nov 3, 2005, at 3:53 PM, Jim Correia wrote:
When running on 10.4, NSTextField supports undo. This works great
in a "no code" application which uses regular windows and floating
panels.
If I build an "almost no code" application and have text fields in
a sheet, they don't get undo support. Returning an undo manager
from windowWillReturnUndoManager doesn't seem to help.
What do I need to do to make this work?
Watching things go by in the debugger, it looks like undo support is
specifically disabled for sheets? If I use a subclass of NSPanel
which returns NO for isSheet (obviously not a shippable solution) my
text fields start getting undo support.
#0 -[MyPanel isSheet] (self=0x5db630, _cmd=0x90a1e23c)
#1 0x9377f280 in _responderWhichRespondsToAction ()
#2 0x93725f4c in _NSTargetForSendAction ()
#3 0x9377eff8 in -[NSMenu _enableItems] ()
#4 0x9377d070 in AppKitMenuEventHandler ()
#5 0x93184ff4 in DispatchEventToHandlers ()
#6 0x9318474c in SendEventToEventTargetInternal ()
#7 0x9318b4ec in SendEventToEventTarget ()
#8 0x9321dd64 in SendMenuOpening ()
#9 0x9321d80c in DrawTheMenu ()
Is there something about NSTextFields that make them undeserving of
undo in sheets? (Or do sheets have some special undo phobia?)
Is there anything I can do in my app to make this work?
Jim
------------------------------
_______________________________________________
Cocoa-dev mailing list
email@hidden
http://lists.apple.com/mailman/listinfo/cocoa-dev
End of Cocoa-dev Digest, Vol 2, Issue 1735
******************************************
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden