• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Solved: widgets don't work properly in a bordrless window?!?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Solved: widgets don't work properly in a bordrless window?!?


  • Subject: Re: Solved: widgets don't work properly in a bordrless window?!?
  • From: "Clark S. Cox III" <email@hidden>
  • Date: Wed, 20 Nov 2002 14:46:41 -0500

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Wednesday, Nov 20, 2002, at 08:54 US/Eastern, Ondra Cada wrote:

On Wednesday, Nov 20, 2002, at 12:23 Europe/Prague, Marco Binder wrote:

Ondra, I m not sure on this one, but the docs say:

- (BOOL)canBecomeKeyWindow

Returns YES if the receiver can become the key window, NO if it can't. Attempts to make the receiver the key window are abandoned if this method returns NO. NSWindow's implementation returns YES if the receiver has a title bar or a resize bar, NO otherwise.

So I'd guess, it returns NO for a borderless window. If I d take a shot on this one, I d say you ll have to make it return YES.

Right. I'm pretty dumb not to consider this myself -- just tested, it works like a charm. Thanks!

And here is my question for you: is it possible to use a category to override a function? Or do you have to subclass NSWindow?

Just to make this clear:

- you can override any method using a category (including this one);
- there's a catch though: if the method itself came from another category (or if more categories override the same method, which is more or less the same), the selection of the method which will be used to respond to the appropriate message is essentially random (matter of fact, it's the one of the category loaded last);
- there's another catch: using a category, you change a behaviour of the class itself, ie. of *all* windows in the application. Often it's what you want, but generally you might consider subclassing just to be able to choose those instances which should have the new behaviour.

Another reason to prefer subclassing: There is no way to call the original method from a category (i.e. the equivalent of [super someMethod]), it is effectively lost.


- -- http://homepage.mac.com/clarkcox3/
email@hidden
Clark S. Cox, III
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (Darwin)

iEYEARECAAYFAj3b5qcACgkQd6STocYT1xWSQwCeIGK32h1Iksx0E0U/Fhn3Xkkk
oqkAn2ZV+4rnA4a4s5O6so7GxOQJX/Er
=o07l
-----END PGP SIGNATURE-----
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Solved: widgets don't work properly in a bordrless window?!? (From: Ondra Cada <email@hidden>)

  • Prev by Date: Re: Database
  • Next by Date: Re: Exclusive File Access
  • Previous by thread: Solved: widgets don't work properly in a bordrless window?!?
  • Next by thread: Re: Solved: Focused UI element, UNSOLVED: widgets don't work properly in a bordrless window?!?
  • Index(es):
    • Date
    • Thread