Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent NSMenu from creating multiple instances of same NSWindow when clicked

I have a simple Cocoa Application that launches a NSWindow when an NSMenu item is clicked. I am initiating the window via a segue. The problem is when I click the menu item multiple times it keeps creating new windows instead of bringing the existing window to the foreground. How can I prevent this behavior? Thanks in advance.

like image 371
django-d Avatar asked Dec 08 '22 01:12

django-d


1 Answers

  1. Select destination window controller
  2. Click attribute inspector and select under Presentation "Single" instead of "Multiple"

Single window instance

like image 125
Marek H Avatar answered Jan 23 '23 12:01

Marek H