discuss-gnustep
[Top][All Lists]
Advanced

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

Re: One Question


From: Richard Frith-Macdonald
Subject: Re: One Question
Date: Thu, 26 Apr 2001 20:10:51 +0100

On Thursday, April 26, 2001, at 07:31 PM, YJCHEN wrote:


  Sorry for misleading.
  I set Black as a Instance Method.
  I put the source code in:
  http://www.people.virginia.edu/~yc2w/GNUstep/en/error.html
  You can just check the Red methond in AppDelegate.m
  and Black method in ImageWindow.m

  I use AppDelegate to create a instance of ImageWindow,
  then use ImageWindow *keyWin = [NSApp keyWindow]
  to get the key instance of ImageWindow.

But how do you know that the window being returned by keyWindow is
your ImageWindow instance?  It might not be, and your code doesn't
check.

In fact, looking at your code, I can see that your image window is
never ordered in, and so could not become a key window, while its
createWindow method actually creates and orders in a normal NSWindow
instance ... which is presumably what you end up sending the
'black' message to.



reply via email to

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