Project

drink-menu

0.01
No commit activity in last 3 years
No release in over 3 years
An easy way to define menu items and visually lay out menus for your OSX apps. Uses ReactiveCocoa to provide a nice syntax for responding to menu interactions. Also provides live-binding to collections, which makes keeping menus up-to-date a breeze!
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
~> 10.0.0

Runtime

 Project Readme

DrinkMenu

Installation

Add this line to your application's Gemfile:

gem 'drink-menu'

And then execute:

$ bundle

Or install it yourself as:

$ gem install drink-menu

Usage

Drink Menu separates menu layout from menu definition. Menu definition looks like:

class MainMenu
  extend DrinkMenu::MenuBuilder

  menuItem :progress do |item|
  end

  menu :sites_list, itemsFromCollection: Staticly.sitesList, titleProperty: :name

  menuItem :open_site, title: 'Open Site', submenu: :sites_list

  menuItem :create_site, title: 'Create Site'
  menuItem :export, title: 'Export to Folder...'
  menuItem :import, title: 'Import Folder as Site...'
  menuItem :force_rebuild, title: 'Force Rebuild'
  menuItem :about, title: 'About Staticly'
  menuItem :quit, title: 'Quit'


  iconImage = NSImage.imageNamed "status-icon-off"
  iconImage.template = true

end

and then layout is as simple as:

class MainMenu
  extend DrinkMenu::MenuBuilder

  statusBarMenu :main_menu, icon: iconImage, statusItemViewClass: StatusItemView do
    open_site
    create_site
    ___
    export
    import
    force_rebuild
    ___
    about
    quit
  end

end

See the example for basic usage. More detailed documentation & examples coming soon.

See my recent blog post for a bit more information.

Running the Examples

To run our example apps:

  1. Clone this repo
  2. From within your clone's root, run platform=osx example=basic_main_menu rake

You can replace the value of example with any folder under the examples directory to run that example.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request