Does someone has experience with the NSUndoManager ?

Mac OSX specific forum
Wolfram
Enthusiast
Enthusiast
Posts: 567
Joined: Thu May 30, 2013 4:39 pm

Does someone has experience with the NSUndoManager ?

Post by Wolfram »

Does someone has an example to work with the OSX internal Undo function?
Lets say I have an array with four values. How can I undo/redo the data of these array?
macOS Catalina 10.15.7
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Does someone has experience with the NSUndoManager ?

Post by wilbert »

Wolfram wrote:Does someone has an example to work with the OSX internal Undo function?
Lets say I have an array with four values. How can I undo/redo the data of these array?
Do you mean a normal array or a NSArray ?
I believe this undo function only works with objects and not with a PureBasic array.
Windows (x64)
Raspberry Pi OS (Arm64)
Wolfram
Enthusiast
Enthusiast
Posts: 567
Joined: Thu May 30, 2013 4:39 pm

Re: Does someone has experience with the NSUndoManager ?

Post by Wolfram »

wilbert wrote: Do you mean a normal array or a NSArray ?
I believe this undo function only works with objects and not with a PureBasic array.
Hi Wilbert,
well for the beginning an an NSArray is ok.
Maybe we could use an pb pointer to read the NSArray more easy inside of pb?
*myNSArray[1]\value
macOS Catalina 10.15.7
wombats
Enthusiast
Enthusiast
Posts: 663
Joined: Thu Dec 29, 2011 5:03 pm

Re: Does someone has experience with the NSUndoManager ?

Post by wombats »

I know this isn't what you're asking, but if you don't want to mess with OS specific stuff and want a cross-platform system, srod's Demento is really good.

Forum topic: viewtopic.php?f=12&t=42867
Download: http://backup.rsbasic.de/?file=Demento.zip
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Does someone has experience with the NSUndoManager ?

Post by wilbert »

Wolfram wrote:well for the beginning an an NSArray is ok.
Maybe we could use an pb pointer to read the NSArray more easy inside of pb?
*myNSArray[1]\value
I looked at it but find it hard to understand how to use it. :(
You have to provide specific methods so the undo manager knows how to redo something.
Windows (x64)
Raspberry Pi OS (Arm64)
Wolfram
Enthusiast
Enthusiast
Posts: 567
Joined: Thu May 30, 2013 4:39 pm

Re: Does someone has experience with the NSUndoManager ?

Post by Wolfram »

wilbert wrote: I looked at it but find it hard to understand how to use it. :(
Ok, if YOU say it is hard to understand it is no shame for me to give up. ;-)
macOS Catalina 10.15.7
Post Reply