NSRulerView and drawBackgroundInRect

  • It has been stated on this list (http://www.cocoabuilder.com/archive/message/cocoa/2007/5/2/182751
    ) that "NSRulerView has the following method: -
    (void)drawBackgroundInRect:(NSRect)rect;"

    I haven't found a method of that name in any documentation, including
    NSRulerView.h. Is this a private method? Is it safe to rely on it? Or
    am I embarrassing myself by overlooking something simple?
  • On Jan 31, 2008, at 10:49 AM, Ross Carter wrote:

    > It has been stated on this list (http://www.cocoabuilder.com/archive/message/cocoa/2007/5/2/182751
    > ) that "NSRulerView has the following method: -
    > (void)drawBackgroundInRect:(NSRect)rect;"
    >
    > I haven't found a method of that name in any documentation,
    > including NSRulerView.h. Is this a private method?

    Yes

    > Is it safe to rely on it?

    In that it's never safe to rely on undocumented private methods, no.
    Not only can they go away or do something else, people using them have
    caused Apple engineers to have to make special workarounds to try to
    keep things from breaking in future versions (there is some special
    behavior with table views, for example, that is based on what SDK you
    link against - pretty much my definition of an ugly workaround).

    > Or am I embarrassing myself by overlooking something simple?

    Your "spidey sense" was spot on...

    Glenn Andreas                      <gandreas...>
      <http://www.gandreas.com/> wicked fun!
    quadrium2 | build, mutate, evolve, animate  | images, textures,
    fractals, art
  • On Jan 31, 2008, at 12:17 PM, glenn andreas wrote:

    > On Jan 31, 2008, at 10:49 AM, Ross Carter wrote:
    >
    >> It has been stated on this list (http://www.cocoabuilder.com/archive/message/cocoa/2007/5/2/182751
    >> ) that "NSRulerView has the following method: -
    >> (void)drawBackgroundInRect:(NSRect)rect;"
    >>
    >> I haven't found a method of that name in any documentation,
    >> including NSRulerView.h. Is this a private method?
    >
    > Yes
    >
    >> Is it safe to rely on it?
    >
    > In that it's never safe to rely on undocumented private methods,
    > no.  Not only can they go away or do something else, people using
    > them have caused Apple engineers to have to make special workarounds
    > to try to keep things from breaking in future versions (there is
    > some special behavior with table views, for example, that is based
    > on what SDK you link against - pretty much my definition of an ugly
    > workaround).

    Thanks, Glenn. I've filed a bug (5717504) asking that
    drawBackgroundInRect: be declared public. In the meantime, I guess
    there's no alternative but to use it anyway. NSRulerView uses the
    window background color as its background, and it looks terrible if
    the window is textured.
previous month january 2008 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today