Bad idea to set NSTextView's frame in -drawRect:? #69

Closed
indragiek opened this Issue Feb 26, 2013 · 3 comments

Comments

Projects
None yet
3 participants
Contributor

indragiek commented Feb 26, 2013

I've brought this up with @jspahrsummers earlier, but it seems to me like all things considered, setting the frame of a view in it's -drawRect: method is a bad idea. I think registering for NSViewFrameDidChangeNotification and altering the frame there is a better solution. We discussed earlier that it may be possible that the implementations of some NSView subclasses (NSTextView, in this case) could be setting the frame without using the appropriate accessor or triggering the notification, but unless evidence is found to suggest otherwise, I'd say it's a safe assumption that this notification will be posted on frame change.

Of course, if you guys have already tried this and ran into issues with it it's reasonable to keep this around.

Contributor

jspahrsummers commented Feb 26, 2013

No, I don't think we tried the notifications before.

Have a crack in a pull request and submit it :).

Contributor

indragiek commented Feb 27, 2013

Will do!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment