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 8591647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:34:28+00:00 2026-06-11T23:34:28+00:00

As you know in 10.7 the windows can be resized by the user from

  • 0

As you know in 10.7 the windows can be resized by the user from all sides and corners. Is there any way to restrict the resizing of an NSWindow to only one side? Using setMinSize:and setMaxSize: won’t do everything: by using those you can only restrain the resizing to two sides, not one.

  • 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-06-11T23:34:29+00:00Added an answer on June 11, 2026 at 11:34 pm

    To fix the cursor, track the mouse position use the mouseMoved event of an NSWindow subclass. When it is close to the top, call setMinSize = setMaxSize = whatever size the window is. When the mouse is closer to the bottom than the top, change the min size and max size back to whatever will let the user resize in the way you want them to.

    Note that mouseMoved gets called whether the mouse is inside the window or outside of it (in my testing at least), as long as the window has focus. But for this to work, first implement -(BOOL) acceptsMouseMovedEvents { return YES; } in your NSWindow subclass.

    As an extra safeguard, you can intercept and prevent any attempts at resizing using windowWillResize (not windowDidResize) in an NSWindowDelegate. From the Apple documentation:

    -(NSSize)windowWillResize:(NSWindow *)sender toSize:(NSSize)frameSize

    …

    The frameSize contains the size (in screen coordinates) sender will be resized to. To resize to a different size, simply return the desired size from this method; to avoid resizing, return the current size. sender’s minimum and maximum size constraints have already been applied when this method is invoked.

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

Sidebar

Related Questions

I know I can communicate with my Windows Workflow host (FROM my workflow) using
In Windows Forms , you can know, at any time, the current position of
As I know, when I run cs myConsoleApp.cs from windows command line, I can
Is there any way I can force a floated div to shrink instead of
I know on client side (javascript) you can use windows.location.hash but could not find
I know we can enumerate the windows controls with in the dialog and using
Does anybody know where I can find a utility/application running on Windows that analyses
I would like to know if I can install IIS 7.5 on Windows Server
I know how to attach a debugger to a windows service, but I can't
I trying to make a Control that inherits from System.Windows.Form.Label that can resize to

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.