• 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: Resize transparent windows
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Resize transparent windows


  • Subject: Re: Resize transparent windows
  • From: Stéphane Sudre <email@hidden>
  • Date: Wed, 9 Jan 2002 13:23:18 +0100

I am trying to figure out how to resize a transparent window just like the
one that is found in the roundTransparentWindow example given by Apple.

I am thinking about putting handles (a transparent sensitive area) all
around the window shape, 10 pixels wide, where one could 'click and drag' to
make the window and the picture inside shrink or grow.

Has anyone ever thought about that and could give me some directions about
the logic and the objects I should use to achieve it ?

You can do this using your subclass of NSWindow. Since it must be there you're handling the ability to drag your window, you can complete the folowing methods to handle resizing:

- (void)mouseDown:(NSEvent *)theEvent
{
if in the drag region then draglocation is this one and the dragged flag is on
else if in the resize region then resizelocation is this one and the resize flag is on
}

- (void)mouseUp:(NSEvent *)theEvent
{
all flags off
}

- (void)mouseDragged:(NSEvent *)theEvent
{
if (dragged flag is on) moveWindow according to drag
else if (resize flag is on) resize window according to drag
}

The eventual drawing of the resizing zone can be performed by the View which defines the frame of your window.

If you're able to have your controls inside your window enabled, I'm interested.


References: 
 >Resize transparent windows (From: Bertrand Mansion <email@hidden>)

  • Prev by Date: Resize transparent windows
  • Next by Date: PDF on a NSView
  • Previous by thread: Resize transparent windows
  • Next by thread: Re: Resize transparent windows
  • Index(es):
    • Date
    • Thread