Ref : First Steps in GNUstep GUI Programming (2) : NSWindow,  NSButton
Edition : First Edition: July 2000; Last Updated: January 2008
URL : http://www.gnustep.it/nicola/Tutorials/WindowsAndButtons/index.html

Hi Nicola (Pero),
Hi All,

I wish first to thank You, Nicola, for the great tutorials You made.
They helped Me to understand and begin my learning pretty well.

Trying to play and understand the final code in the Tutorial 'First Steps in GNUstep GUI Programming (2) : NSWindow, NSButton', I was facing to some warnings and bugs. I think You should modify the final code listing at page 9, in the '@implementation' section like this :

(1) In the method 'dealloc' :

- (void) dealloc
{
  RELEASE (myWindow);
  /* According to a warning while making the app */
  [super dealloc];
}

(2) In the method 'createWindow' :

- (void) createWindow
{
...
myWindow = [NSWindow alloc];

  /* Don't make a assignment of 'myWindow' again...
  myWindow = */
  /* So I kept only the message... */
  [myWindow initWithContentRect: rect
                       styleMask: styleMask
                       backing: NSBackingStoreBuffered
                       defer: NO];

 /* Here, the contentView was obviously missing : I added it... */
[myWindow setContentView: myButton];
...
}

I Hope this could be helpful for other Beginners like Me. ;-)

Regards,


--
Bien cordialement,
Patrick CARDONA


  • ... Patrick Cardona via Discussion list for the GNUstep programming environment
    • ... Richard Frith-Macdonald
      • ... Patrick Cardona via Discussion list for the GNUstep programming environment
    • ... David Chisnall
      • ... Patrick Cardona via Discussion list for the GNUstep programming environment
      • ... Patrick Cardona
        • ... David Chisnall

Reply via email to