Hi, everyone, I'd like to add some default values to the rik.theme, writable 
with the "defaults" tool.
I wanted to add a transparency level to the top menu bar, which would be 
editable. I thought I could do something like this :

- (NSColor *) menuBackgroundColor
{
  float transparency = 1.0;
  NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 
   if ([defaults floatForKey:@"menubartransparency"])
    {
      transparency = [defaults floatForKey:@"menubartransparency"];
      }
   
  NSColor *color = [NSColor colorWithCalibratedRed: 0.992 green: 0.992 blue: 
0.992 alpha: transparency];
  return color;
}

I get then a warning :  "local declaration of ‘defaults’ hides instance 
variable"
And when I read the documentation, I see that [NSUserDefaults 
standardUserDefaults] is for the current app and user.
A theme is not an app but a bundle. rik dosn't have such thing as an app 
controller to initiate the database at start-up. Can I create a defaults 
database for it, and how ? 

Bertrand



_______________________________________________
Discuss-gnustep mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to