• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Vanishing Toolbar, Part II
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Vanishing Toolbar, Part II


  • Subject: Vanishing Toolbar, Part II
  • From: Carl Jochen Norum <email@hidden>
  • Date: Fri, 14 Jun 2002 15:21:47 -0600

Well - the problem is still around, but it appears that at least someone else
has noticed that certain conditions (god knows what) make all of the standard
(read - simple image type) toolbar items vanish.

I'm referring to this line from the OmniAppkit, in OAToolbarImageView.h:

// Workaround for a bug in NSToolbarItem where custom views that respond to
// setImage end up having that method called twice and their image tus destroyed.

I expect that this is what's happening to my disappearing icons. I'd love to
see how this Omni class provides a workaround, but I can't figure out how to
get it to work!

What's the MO for getting a class of this type into the toolbar? I tried:

NSToolbarItem *item = [[NSToolbarItem alloc] init];

[item setPaletteLabel:@"Clear Image"];
[item setLabel:@"Clear Image"];
[item setToolTip:@"Click to remove the image."];
[item setView:[[[OAToolbarImageView alloc] initWithFrame:NSZeroRect]
autorelease]];
[(OAToolbarImageView *)[item view] reallySetImage:
[NSImage imageNamed:@"delete.tiff"]];
[[item view] sizeToFit];
[item setTarget:self];
[item setAction:@selector(clearImage:)];

[toolbarItems setObject:item forKey:@"Clear Image"];
[item release];

But nothing shows up, and I can't click on the icon. Thanks for any insight
you may be able to provide!

-- Carl "Help!" Norum
_______________________________________________
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.

  • Prev by Date: Re: NSMenuItem setImage:
  • Next by Date: Re: -[NSTextField setStringValue]
  • Previous by thread: Re: NSMenuItem setImage:
  • Next by thread: Persistant Warning
  • Index(es):
    • Date
    • Thread