gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about NSUndoManager


From: Germán Arias
Subject: Re: Question about NSUndoManager
Date: Mon, 04 Nov 2013 19:23:32 -0600
User-agent: GNUMail (Version 1.2.0)

On 2013-11-03 10:24:24 -0600 Riccardo Mottola <address@hidden> wrote:

> Hi Germn,
> 
> Germn Arias wrote:
>> Try this:
>> 
>> 1: Open Graphos.
>> 2: Display the "Edit" menu.
>> 3: Add some object to the document, and don't move
>>       the mouse out of the document window.
>> 4: The "Undo" menu item don't display a title.
>> 5: Move the mouse out of the document
>>        window, the title of the item is now updated.
>> 
>> Is this a bug on GNUstep? Or a problem in Graphos?
>>    
> I can't reproduce it. I have seen in the past sometimes "blank" Undo
> menus, but was never able to have a testcase. I neatly get Undo create
> Box, Circle, Path...
> 
> Riccardo
> 
> 

Well, I don't know why you can't reproduce this problem. But I found
the problem on my machine. When the app register an undo action,
it creates an object UndoGroup. Then when the action terminates, the
menu is updated. And ask for the title of item undo. NSUndoManager
return the title of last object in _undoStack. But the object _group is
not yet at _undoStack. So, this returns null. So, I solve this with:

  if (_group != nil)
    {
      return [_group actionName];
    }
  else
    {
      return [[_undoStack lastObject] actionName];
    }

I will do more test to check that this don't break anything.

Germán.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]