Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4068864
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:25:42+00:00 2026-05-20T16:25:42+00:00

I want to display an NSAlert with basically an Accessory view. The Accessory view

  • 0

I want to display an NSAlert with basically an Accessory view. The Accessory view needs to have:

1) NSTexView for displaying mandatory contents

2) Disclosure button with NSTextView

The Disclosure button is required to hide and show the second NSTextView. However, at the same time i want that NSAlert dialog resize to accomodate and fit to contents.
The Save dialog in Cocoa has a disclosure button that basically does this and i want the same functionality with NSAlert.
Suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T16:25:42+00:00Added an answer on May 20, 2026 at 4:25 pm

    Here you go:

    1) NSAlert has a window property. Hence use that.

    2) Create a custom accessory view containing two NSTextView’s and a disclosure triangle

    3) Set this custom view as accessory view of NSAlert

    4) Before displaying the alert, set the window property of NSAlert in your custom view (This way you will have access to NSAlert’s window when you click disclosure triangle)

    5) Add target for the disclosure button event and save the state (expanded/collapsed)

    6) In the event for disclosure triangle click: Use NSAlert’s saved window frame to adjust the height, size and width of NSAlert.

    7) Important here is to note that – when you adjust the height, NSAlert grows from top hence you will be required to move the “origin” accordingly.

    Hope this helps :). I had to spend entire weekend to figure out how to do this :D.
    BTW, just out of curiosity which project or company are you working on?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple quiz application and I want display a nice timer /
i want to display some information in a listview using the GridView. i have
I want to display the current host and database names in a view. Where
I want to display an image within a scroll area. The view port of
I want display images in gallery view it want to focus to paticular image
I have this XML i want display all fields on the uiview which comes
I have a problem with my datatable, I want display the information of a
I want to display data on table view cell from the database so I
In below code i want display tag of each button on console. I tried
I want display an image instead of downloading it. I have image in my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.