objective c - NSPopUpButton + Bindings + Show All Option -


I am trying to develop a NSPopUpButton filter for some data sources Will work in the form, let's fill a table with a NSArrayController .

I can tie the selection from the menu to the NSArrayController in order to filter the data properly, no problem with it

is a tricky part, I want to use the content of this NSPopUpButton on a NSArrayController , but I want to add a "Show all" "Menu items, or at least some of the items that do not come with core data, and do some special functions in addition to filtering the table using bindings and core data.

I'm trying to do something like the NSPopUpButton used by Finder in the filter bar, the last item of the menu works special, while others only filter the results Are there.

I understand that approaches forget about binding and do all this programmatic Lly, because I believe there is no way to mess with the NSArrayController No, and binding to add custom menu items that does not rely on core data, but since I have not found anything on Apple Docs and here, I would like to share my thoughts ... any thoughts?

I like you looking for NSContentPlacementTagBindingOption.

You edit the NSMenu that is attached to NSPopupButton

pop Set-up menu button's menu

Then you can edit the settings on NSMenuItem that you want to replace with your array controller content so that this is a meaningful tag associated with it < P> Settings for items which are dynamically being replaced by binding

Then you can add that tag The programming content placements specified binding NSPopupButton material / co as tag values ​​Ntent * bindings.

Binding for pop-up button

Comments