bug-gnustep
[Top][All Lists]
Advanced

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

Re: NSMenu menu position saving bug (PATCH)


From: Michael Hanni
Subject: Re: NSMenu menu position saving bug (PATCH)
Date: Sat, 10 Jan 2004 10:23:33 -0600

Hi,

On 2004-01-10 01:59:05 -0700 Richard Frith-Macdonald <richard@brainstorm.co.uk> wrote:

On 10 Jan 2004, at 15:13, Michael Hanni wrote:

so the key was always nil (interestingly enough, if I manually edited the key in the defaults to be \033Info it worked properly). I changed this to:

So it sounds like the escape character was not saved into the defaults ... either a problem with the escape in the string, or a problem with converting it back to the four character sequence ('\\', '0', '3', '3') it should be coded as in the defaults database.

If I change this to \\033 instead of \033 it works ok... Is it that when you give \033Info to NSString in a cstring it tries to come up with a character with value 033I?

With the current code, minus my modification, my defaults are always this:

        NSMenuLocations = {
            "\000" = "136 379 77 233 0 0  960 768 ";
            "\000Edit" = "626 325 79 128 0 0  960 768 ";
        };

Notice the key is "\000" not "\033". So on the console I see "dit".

More importantly, if something is going wrong with strings containing escape characters, you may have much more fundamental problems than just losing your menu location!

I'm guessing \033I is not a valid escape character?

Two places to look ... The string is initialised by code in base/Source/GSFormat.m The output conversion for the defaults database is in GSCompatibility.m (the PString() function)

I looked at this code, but it is way over my head.

Anyhow, using "+" or even "\\033" the defaults are saved correctly. With only "\033" it fails everytime on my machine.

This is on a powerpc machine, debian linux, gcc 3.3.3-0pre1, and libc6 2.3.2.ds1-10.

Any ideas?

Michael





reply via email to

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