gnustep-dev
[Top][All Lists]
Advanced

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

Re: Question on GSDrawingFunctions


From: Fred Kiefer
Subject: Re: Question on GSDrawingFunctions
Date: Mon, 02 Feb 2004 12:03:22 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030821

Adam Fedor wrote:

On Sunday, February 1, 2004, at 04:43 AM, Fred Kiefer wrote:


Up to now my understanding, based on the names of the functions, was that there used to be a series going from light to dark:
NSDrawWhiteBezel
NSDrawLightBezel
NSDrawGrayBezel
NSDrawDarkBezel



No, I'm pretty sure that NSDrawLightBezel and NSDrawDarkBezel are the color-configurable replacements for NSDrawWhiteBezel and NSDrawGreyBezel, respectively. They should be equivalent (except for drawing the inside of the rect) when using the default colors.


If nobody knows for sure, why don't we just check? I have attached a small application that will draw all the different bezel versions and if somebody with an OpenStep or Cocoa system runs this and sends back a screenshot of the resulting window we should know. If the Light and Dark variants are sensitive to defult colour settings they need of course tests with different values in the system colour list.
/* 
   Tester for bezel borders
   Copyright (C) 2004 Free Software Foundation, Inc.

   Written by: Fred Kiefer <address@hidden>
   Created: Febuary 2004

   This file is part of the GNUstep Base Library.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public
   License along with this library; if not, write to the Free
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
*/
#include <Foundation/NSAutoreleasePool.h>
#include <Foundation/NSString.h>
#include <AppKit/NSApplication.h>
#include <AppKit/NSBezierPath.h>
#include <AppKit/NSColor.h>
#include <AppKit/NSMenu.h>
#include <AppKit/NSView.h>
#include <AppKit/NSWindow.h>

#include <AppKit/PSOperators.h>

@interface AppController: NSObject
{
}
@end


@implementation AppController

-(void) draw
{
    NSDrawWhiteBezel(NSMakeRect(10, 10, 50, 50), NSZeroRect);
    NSDrawLightBezel(NSMakeRect(10, 80, 50, 50), NSZeroRect);
    NSDrawGrayBezel(NSMakeRect(80, 10, 50, 50), NSZeroRect);
    NSDrawDarkBezel(NSMakeRect(80, 80, 50, 50), NSZeroRect);
}

- (void)applicationDidFinishLaunching:(NSNotification *)notification
{
  NSWindow *aWin;
  NSMenu *menu = [NSMenu new];

  [menu addItemWithTitle: @"Quit"
        action: @selector(terminate:)
        keyEquivalent: @"q"];
  [NSApp setMainMenu: menu];
  RELEASE(menu);

  aWin = [[NSWindow alloc] initWithContentRect: NSMakeRect(200,200,140,140)
                           styleMask: NSTitledWindowMask
                           backing: NSBackingStoreBuffered
                           defer: NO];
  [aWin setBackgroundColor: [NSColor blueColor]];
  [aWin makeKeyAndOrderFront: nil];
  
  [[aWin contentView] lockFocus];
  [self draw];
  [[aWin contentView] unlockFocus];
  [aWin flushWindow];
}

@end

int main (int argc, const char *argv[])
{
  CREATE_AUTORELEASE_POOL(pool);
  id app;

  app = [NSApplication sharedApplication];
  [app setDelegate: [AppController new]];
  [app run];
  RELEASE(pool);
  return 0;
}

reply via email to

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