Skip navigation.
 
mlNSScrollView and NSMenu problems
FROM : Andreas Schwarz
DATE : Thu Jan 10 23:37:08 2002

I've got two questions today.

First is a problem I'm having with an NSScrollView.  I've set the
NSClipView's setCopiesOnScroll: to YES.  This works wonderfully, exactly
as expected, when I'm scrolling downwards.  The document view (a custom
view of mine) gets passed an appropriate rectangle in the drawRect:
method that describes only the newly exposed part of the frame. 
However, when I scroll upwards it doesn't work.  The drawRect: method
gets passed a rect equal to the view's visible frame as if
setCopiesOnScroll: were set to NO.  Does anyone have any ideas on why
this is happening?  I've tried, but I can't figure it out.

Second, I'm experiencing a problem with my app's main menu.  At times I
add or remove menu items from it (depending on what type of window is
key).  Removing them isn't a problem; I call [[NSApp mainMenu]
removeItem:theMenuItem] and the menu item disappears from the main
menu.  Adding the menu item, however, doesn't work quite so smoothly.  I
call [[NSApp mainMenu] insertItem:theMenuItem atIndex:theIndex] and
while it DOES add the menu item to the menu, the menu display does not
get updated until the user clicks on the menu, at which point the added
menu will suddenly show up.  I have tried calling various methods like
[[NSApp mainMenu] update] and [[NSApp mainMenu] sizeToFit] in the hopes
that it would update the menu's display, but to no avail. What am I
doing wrong?

Thanks in advance,
Andreas Schwarz


Related mailsAuthorDate
mlNSScrollView and NSMenu problems Andreas Schwarz Jan 10, 23:37
mlRe: NSScrollView and NSMenu problems Erik M. Buck Jan 12, 21:00
mlRe: NSScrollView and NSMenu problems Andreas Schwarz Jan 13, 02:04
mlRe: NSScrollView and NSMenu problems Jim Correia Jan 13, 03:27
mlNSImage rendering problems in a CustomView rgrant Jan 13, 05:42
mlRe: NSImage rendering problems in a CustomView rgrant Jan 13, 11:19
mlRe: NSImage rendering problems in a CustomView rgrant Jan 14, 03:56