• 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
Problem with disclosure triangle (resizing Cocoa view) in Logic
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with disclosure triangle (resizing Cocoa view) in Logic


  • Subject: Problem with disclosure triangle (resizing Cocoa view) in Logic
  • From: christian <email@hidden>
  • Date: Mon, 22 Aug 2005 11:35:32 -0400

I've created a Cocoa view for my AU plugin, and it contains some non- critical controls that are in a disclosable "expert" section, similar to those in the AU Lab General Preferences pane.

The attached code works and looks good in AU LAb, but in Logic (latest) the entire view is shifted up and out of the window's view.

Can someone point out what I've done wrong with this code? Or, suggest a better way of doing this? I guess it's causing a problem that I'm subtracting from the y origin; but why does it work in AU Lab? I'm fairly inexperienced at Cocoa programming, so some of this was written as a stab in the dim light.

The UI is panted in IB with all of the "export" controls laid out in an NSBox (bound to member field "uiExtraControls") with the "hidden" box checked in the Attributes Inspector. The method iaToggleExtraControls is bound to the disclosure triangle button. All of the controls in the main view have "springy" connections (Size Inspector) to the bottom of the main view.

Thanks,
christian


- (void) awakeFromNib { NSRect rect; float windowDelta = 0;

    rect        = [uiExtraControls frame];
    windowDelta    = rect.size.height;

    rect                = [self frame];
    rect.size.height    -= windowDelta;
    rect.origin.y        -= windowDelta;

    [self setAutoresizingMask:NSViewMinYMargin];
    [self setFrameSize:rect.size];

}

- (IBAction)iaToggleExtraControls:(id)sender
{
    NSWindow *    window        = [self window];
    NSRect        rect;
    float        windowDelta    = 0;

    rect        = [uiExtraControls frame];
    windowDelta    = rect.size.height;

    bool isHidden = [uiExtraControls isHidden];
    if (! isHidden)
    {
        windowDelta *= -1;
    }

    // resize the view size
    rect                = [self frame];
    rect.size.height    += windowDelta;
    [self setAutoresizingMask:NSViewMinYMargin];
    [self setFrameSize:rect.size];

    // resize the window
    rect                = [window frame];
    rect.size.height    += windowDelta;
    rect.origin.y        -= windowDelta;

    [window setFrame:rect display:YES animate:YES];

    [uiExtraControls setHidden:(!isHidden)];
}

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Problem with disclosure triangle (resizing Cocoa view) in Logic
      • From: Michael Hopkins <email@hidden>
  • Prev by Date: ANN: Audiofile Engineering releases Wave Editor 1.0
  • Next by Date: Re: Problem with disclosure triangle (resizing Cocoa view) in Logic
  • Previous by thread: ANN: Audiofile Engineering releases Wave Editor 1.0
  • Next by thread: Re: Problem with disclosure triangle (resizing Cocoa view) in Logic
  • Index(es):
    • Date
    • Thread