I agree. And that’s exactly what Pages (an Apple application) does in its window’s toolbar.
I’ll use a good old-fashion loop to get the job done, consistant or not. My app is just for my usage anyway.
Thank you all!
I agree. And that’s exactly what Pages (an Apple application) does in its window’s toolbar.
I’ll use a good old-fashion loop to get the job done, consistant or not. My app is just for my usage anyway.
Thank you all!
What’s appropriate in a window toolbar isn’t the same as what’s appropriate in an NSPopupButton in a window. I’m not sure which you are doing, but since it’s for your own use then it doesn’t really matter. Happy looping!
Ric
Where exactly?
FWIW, you can use thePopup’s itemArray()'s makeObjectsPerformSelector_withObject_(“setState:”,missing value) instead of using a loop. Maybe passing 0 probably doesn’t work because setState: requires an integer as the argument, and a 0 passed from applescript becomes an NSNumber, whereas “missing value” translates to NULL in Objective-C – I’m guessing this has something to do with passing the argument indirectly in the object parameter, as compared to directly as an argument to setState:. I’ve tried passing various things to setState: in Objective-C, and an NSNumber with a value of 0 doesn’t work to set the state to off (in fact it sets it to on). NULL does work, though it gives you a compiler warning (as does nil). The int 0, FALSE, and NO all work in Objective-C with no warnings, but nothing other than missing value works from ASOC.
Ric