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 > NSToolbar questions.

NSToolbar questions.
Thread Tools
Mac Enthusiast
Join Date: Oct 2001
Status: Offline
Reply With Quote
Apr 19, 2002, 06:34 PM
 
1. Can NSToolbar items have tooltips?

2. The toolbar items 'space' and 'flexible space' both are invisible items that do not show in the toolbar. However they do have a visible icon in the custimization pallete. I need to do this with one of my toolbar items. I am using OAChassingArrows in my app as a toolbar item. These arrows are not visible unless they are moving. When I go to the customization pallete the arrows are of course not visible. I would like to assign them an icon which is visible in the customization pallete. How do the 'space' and 'flexible space' items accomplish this?
3R1C
     
Forum Regular
Join Date: Jan 2002
Location: New York
Status: Offline
Reply With Quote
Apr 19, 2002, 07:18 PM
 
I don't know about number two, but for number one you just do. [toolbarItem setToolTip:@"Ain't this fun?"];
     
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Apr 19, 2002, 09:35 PM
 
I'd like to note that you should really look at the SimpleToolbar example. All of these things are addressed. Basically, for No. 1, there is a paletteImage and a toolbarImage. You just set these. And No. 2 was already addressed.
     
3R1C  (op)
Mac Enthusiast
Join Date: Oct 2001
Status: Offline
Reply With Quote
Apr 19, 2002, 10:58 PM
 
Thanx ksuther, worked like a charm

Synotic: you must have a 'special' SimpleToolbar example, as mine makes no mention of separate images for palette and toolbar. In fact the word "paletteImage" is not in the example.

The only place that setting the image is discussed in the example is this line:

[toolbarItem setImage: [NSImage imageNamed: @"SaveDocumentItemImage"]];

but on the off chance that perhaps my example was not 'special' I tried:

[toolbarItem setPaletteImage: [NSImage imageNamed: @"foo"]];

of course I got -[NSToolbarItem setPaletteImage:]: selector not recognized
and then my app crashed promptly.

the documentation makes no mention of this 'paletteImage' you glibly refer to.

So... anyone else know how apple does this?
3R1C
     
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status: Offline
Reply With Quote
Apr 20, 2002, 03:53 PM
 
Nope, but I know how Omni does.

In the delegate method where you provide toolbar items:
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
- (NSToolbarItem *)toolbar NSToolbar *)toolbar itemForItemIdentifier NSString *)itemIdentifier willBeInsertedIntoToolbar BOOL)flag;
</font>[/code]
you can give back a completely different toolbar item if <font face = "courier">flag</font> is <font face = "courier">NO</font>. You could give back a normal toolbar item with the OAChasingArrows icon, or you could give back a toolbar item with a static image view as its custom view (we use OAToolbarImageView for this purpose).
Rick Roe
icons.cx | weblog
     
   
Thread Tools
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:50 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2