Page 1 of 1

Does someone has experience with the NSUndoManager ?

Posted: Sat Nov 30, 2019 2:46 pm
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?

Re: Does someone has experience with the NSUndoManager ?

Posted: Sat Nov 30, 2019 3:10 pm
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.

Re: Does someone has experience with the NSUndoManager ?

Posted: Sat Nov 30, 2019 4:04 pm
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

Re: Does someone has experience with the NSUndoManager ?

Posted: Sun Dec 01, 2019 5:43 am
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

Re: Does someone has experience with the NSUndoManager ?

Posted: Sun Dec 01, 2019 7:06 am
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.

Re: Does someone has experience with the NSUndoManager ?

Posted: Sun Dec 01, 2019 5:25 pm
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. ;-)