• 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
Visual problem with adding close (X) button to borderless window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Visual problem with adding close (X) button to borderless window


  • Subject: Visual problem with adding close (X) button to borderless window
  • From: Matt Gemmell <email@hidden>
  • Date: Sun, 29 Jun 2003 23:07:21 +0100

Hi there folks,

I'm working on my snap-to-edge NSWindow subclass. In order to allow it
to snap to the edges of the screen *during* a drag (rather than
afterwards, or rather than bouncing around as I fight with the window
server), the window is borderless; i.e. its styleMask is
NSBorderlessWindowMask.

I've programmatically added a standard red close-button (X-widget) to
it, but the button looks visually disabled. Once I set a target and
action for the button, it works as desired - but it still appears
visually disabled (except during a click, when it displays just as it
should during a click).

>From my brief experimentations, it seems that the return value of
styleMask is indeed used to determine whether it appears visually
enabled. Is there any way for me to cause it to show as visually enabled
(not greyed-out), even though my window is borderless?

I'd rather not go down the road of overriding -styleMask and
conditionally "pretending" to be NSTitledWindowMask if the window is
already visible, and having to tell the close-button to redisplay itself
whenever the window is shown. This sort of works (I'm still trying to
convince the button to redisplay itself without me having to
click-drag-off it first), but it feels creaky and hazard-ridden!

I'm hoping there's a more elegant solution. Thanks for any response.

Cheers,
-Matt

--
Matt Gemmell
Scotland Software
http://www.scotlandsoftware.com/
_______________________________________________
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.

  • Prev by Date: Re: [ANN] SS_PrefsController
  • Next by Date: NSBezierPath containsPoint:
  • Previous by thread: Re: [ANN] SS_PrefsController
  • Next by thread: NSBezierPath containsPoint:
  • Index(es):
    • Date
    • Thread