Hacker News new | ask | show | jobs
by mpweiher 2688 days ago
Just checked how many implementations of drawRect there are in different apps:

Pages: 63

Keynote: 81

Numbers: 61

1 comments

Compared to how many uses of ordinary widgets though?

And are those uses because that's how they draw their overall UI -- e.g. do they use drawRect as the main paradigm, or do they merely create new widget looks and behaviors (that they then treat the same as Cocoa ready-made widgets, append to parent, etc)?

E.g. do they draw the UI or some large part of the UI that way, or is just drawRect used to have some custom looking derivative of Button, Label and so on?

There were actually 130 (I had forgotten CALayer's drawInContext:). Of these 100 were either direct NSView subclasses or CALayer subclasses. Of the remaining, a quick scan indicates around 20 direct or indirect subclasses of NSControl.