Git Product home page Git Product logo

obmenubarwindow's Introduction

About OBMenuBarWindow

The OBMenuBarWindow class is an NSWindow subclass that adds the ability to attach the window to an icon in the menu bar in OS X. It emulates much of the look and feel of NSPopover but retains the appearance and functionality of a regular window, including the title bar and traffic light controls. The user can drag the window to and from the menu bar icon to attach and detach it from the menu bar.

Screenshot 1 Screenshot 2

If the user resizes the window while it is attached to the menu bar, it will resize horizontally in a symmetrical manner around the center to give a natural user experience.

It is possible to hide the 'traffic light' controls when the window is attached to the menu bar, if desired.

Notes:

  • OBMenuBarWindow is compatible with OS X 10.7+.
  • It does not use any private APIs, so it is Mac App Store compatible.
  • OBMenuBarWindow uses ARC. If you are using OBMenuBarWindow in a non-ARC project, you will need to set a -fobjc-arc compiler flag on the OBMenuBarWindow source files.
  • If you want an OBMenuBarWindow to be usable while another application is in full-screen mode, create a new entry in your application’s .plist file for LSUIElement of Boolean type and set its value to YES. A side-effect of doing this is that the application’s dock icon will be hidden.
  • OBMenuBarWindow does not support textured windows or standard toolbars.
  • You can alter the height of the title bar and the dimensions of the arrow by changing the value of OBMenuBarWindowTitleBarHeight, OBMenuBarWindowArrowHeight and OBMenuBarWindowArrowWidth in OBMenuBarWindow.m.
  • You can observe the OBMenuBarWindowDidAttachToMenuBar and OBMenuBarWindowDidDetachFromMenuBar notifications from the window object to be notified when the user attaches or detaches the window from the menu bar.
  • You can control the distance of the attached window from the menu bar with the distanceFromMenuBar property.

Getting started

  • Download OBMenuBarWindow and try out the example project.
  • Copy OBMenuBarWindow.h and OBMenuBarWindow.m from the Classes directory and add them to your project.
  • Set your window's class to OBMenuBarWindow.
  • Set your window's icon using the menuBarIcon property, and set the hasMenuBarIcon property to YES.

Documentation

Read the Documentation.

Credits

OBMenuBarWindow was created by Oliver Bolton.

License

OBMenuBarWindow is licensed under the Modified BSD License. See the LICENSE file for more information.

obmenubarwindow's People

Contributors

obolton avatar jayztemplier avatar shsteven avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.