Skip to content

An NSPopUpButton subclass which supports binding to NSTreeController

License

Notifications You must be signed in to change notification settings

brutella/NSTreePopUpButton

Repository files navigation

NSTreePopUpButton

The NSTreePopUpButton class adds supports for binding to a tree controller and displays the tree structure in a hierarchy of menus.

NSPopUpButton Binding

The NSPopUpButton can only display a one dimensional list of objects. The NSTreePopUpButton overwrites the binding to content and selectedIndex to work with a NSTreeController instance.

The content must be bound to arrangedObjects and selectedIndex to selectionIndexPath of a tree controller instance.

binding

The NSTreePopUpButton creates nested menus to represent the object hierarchy. The state of every menu item in the selected index path is set to NSOnState.

menu

Limitations

  • The contentValues options is currently not supported. You should override the var description: String method in your class and return the value you want to display in the menu.
  • The class does not support multiple selections.

Contact

Matthias Hochgatterer

Github: https://github.com/brutella

Twitter: https://twitter.com/brutella

License

NSTreePopUpButton is available under the MIT license. See the LICENSE file for more info.

About

An NSPopUpButton subclass which supports binding to NSTreeController

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages