• 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
Re: NSRulerView markers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSRulerView markers


  • Subject: Re: NSRulerView markers
  • From: Robert Clair <email@hidden>
  • Date: Tue, 17 Jun 2003 12:36:53 -0400

- (void)drawRect:(NSRect)rect
{
[[NSColor controlColor] set];
NSRectFill(rect);
[self drawHashMarksAndLabelsInRect:rect];
[self drawMarkersInRect:rect];
}

This works for me (with [NSColor whiteColor] to get a white background for
the rulers - the user might want to actually read the ruler
rather than look at the nice stripes).

But... I don't use any scrollbars. I have a hand tool to do the
scrolling and the only reason I have a scroll view is to get the
rulers. My view isn't completely hooked up. I want to scroll
by copying pixels and I couldn't get the advertised methods
to work if the scroll wasn't exactly horizontal or vertical.
A printf in my view's drawRect showed the entire rect was
being redrawn (twice) for each mouse drag event. So I do
things myself, including moving the ruler origins.

Also - I have no NSRulerMarkers - just a moving hash mark
following the cursor drawn with

moveRulerlineFromLocation:toLoaction:

Try putting a breakpoint in your drawRect method and see how often
it is called and what is going on at the time.

......Bob
_______________________________________________
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: How to catch this crash?
  • Next by Date: How to have table column headers span multiple columns?
  • Previous by thread: NSRulerView markers
  • Next by thread: Re: Smaller text in NSTableView, possible?
  • Index(es):
    • Date
    • Thread