Re: [beginner] Please help! Insoluble (for me at least) toolbar problem
Re: [beginner] Please help! Insoluble (for me at least) toolbar problem
- Subject: Re: [beginner] Please help! Insoluble (for me at least) toolbar problem
- From: Erika <email@hidden>
- Date: Sun, 9 Mar 2003 14:54:54 +1100
Hello Sherm,
Thanks for replying.
At 12:30 -0500 8/3/03, Sherm Pendley wrote:
>
>
>
Here's the culprit, I think.
>
>
> // toolbar item setup code here...
>
>
>
>/************************************************************************
>
>*******/
>
>- (NSToolbarItem *) toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag
>
>{
>
> NSToolbarItem *toolbarItem = [[NSToolbarItem alloc]initWithItemIdentifier:itemIdentifier];
>
>
You're creating the toolbarItem here...
>
>
> else
>
> {
>
> toolbarItem = nil;
>
> }
>
>
But here, if the identifier isn't one of your custom identifiers - which it won't be, for any of the standard items - you're resetting it to nil.
>
>
sherm--
That makes sense, and I had tried commenting out that bit before (it was only in there in the first place because it was part of a piece of sample code which I had copied), and I even tried adding extra 'else if' clauses for each of Apple's standard toolbar items, but it made no difference.
Somebody sent me some new sample code in response to my post, using an NSDictionary to hold the custom items just as Apple's standard toolbar sample code does, so I concluded that maybe that was the only way to get it to work, and have now heavily modified my code and structured it in the same way. Ahem ... now I am back to where I was a week ago - an empty toolbar - nothing in it at all - not a sausage - and his code is so much more complicated than mine was that I can't follow half of it. I will struggle with it for a few days, but I may end up having to post the new code to the list end of ask for help yet again :-\ . Oh well... thanks anyway for trying to help.
p.s. I will post you the new code I have put together if you think you can make something of it and feel inclined to try... let me know.
>
>
If you listen to a UNIX shell, can you hear the C?
<G> like your signature...
--
_____________________________________________________________________
| Please do not be surprised or annoyed if I fail to answer |
| your post for some time. I am a chronic invalid, and am often |
| unable to use my computer for long periods (days, weeks or months). |
| Be assured that I will, however, reply as soon as I can if I can |
|_____________________________________________________________________|
best,
Erica Mackenzie
Megalong Valley,
N.S.W.
AUSTRALIA
________________________________________________________________
| Windows) 98 (n) - 32-bit extensions and graphical shell |
| for a 16-bit patch to an 8-bit operating system |
| originally coded for a 4-bit microprocessor |
| written by a 2-bit company |
| that can't stand 1 bit of competition. |
|________________________________________________________________|
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.