Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > How to let NSToolBar itme can't be customizable

How to let NSToolBar itme can't be customizable
Thread Tools
yesea
Fresh-Faced Recruit
Join Date: Oct 2004
Status: Offline
Reply With Quote
Apr 14, 2009, 01:10 AM
 
Hi,

When tool bar customizatio palette is running. we can drag and drop his item to custom the tool bar. I have one request. i want one item can't be drag. this way like the XCode IDE, some item can't be customzable. How to relize .thanks for any idea and help

--ann
     
CharlesS
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Apr 15, 2009, 01:30 PM
 
What items are you talking about? All the toolbar items in Xcode seem to be customizable to me.

I don't think what you are asking is possible (short of maybe some icky subclassing on NSToolbar). You can, of course, disallow any customization by sending -[NSToolbar setAllowsUserCustomization:NO], but I don't think you can have it only disallow customization for certain items and not others.

Why do you want to do this?

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
yesea  (op)
Fresh-Faced Recruit
Join Date: Oct 2004
Status: Offline
Reply With Quote
Apr 16, 2009, 09:46 PM
 
Sorry for the confuse. I realy want to disallow customization for certain items on the toolbar,not the all toolbar.

For XCode, i think you use the default setting. Please in XCode Preferences->General->Layout, choose All-in-One. so, open one porject. you can find the Page item disallow customization .
     
CharlesS
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Apr 17, 2009, 12:04 AM
 
Ah, I didn't know about that. Yeah, class-dump reveals that Xcode is using a custom subclass of NSToolbar called PBXToolbar, so it's probable that they wrote the code to disable the customization of that item themselves, unless I'm missing something somewhere.

Why exactly do you want to do this?

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 01:28 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,