Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: property if DrawingArea clips children #4473

Merged
merged 2 commits into from Jul 16, 2015

Conversation

tacaswell
Copy link
Member

Add proprety clip_children to provide user interface if DrawingArea tries to clip it's children.

Did not include get/set methods and used property instead. I hope going forward we will drop the set/get_* methods in favor of some sort of descriptor based solution.

getp/setp should probably be updated to look for properties first and then for getter/setter methods. That can be added to this PR or can be put off until after we sort out if we are going to use traitlets.

Builds on work of @has2k1

@tacaswell
Copy link
Member Author

cf #4466

Add proprety `clip_children` to provide user interface
if DrawingArea tries to clip it's children.
@tacaswell tacaswell force-pushed the enh_offsetbox_clip_children branch from fd8a41b to 7c3c98b Compare June 13, 2015 20:24
@tacaswell tacaswell added this to the next point release milestone Jun 13, 2015
@jenshnielsen
Copy link
Member

👍 Seems sensible to me. However, I would prefer if the __init__ kwarg (clip) and the property had the same name. Perhaps deprecate clip and replace it by clip_children? or the other way round? I think I prefer clip_children since it is more specific and easier to guess the intent of.

@tacaswell
Copy link
Member Author

I am wary of changing the call signature, but on the other hand, this arg didn't do anything until @has2k1 fixed/implemented it in #4466 .

@jenshnielsen
Copy link
Member

I don't feel strongly about this so it up to you

@clip_children.setter
def clip_children(self, val):
self._clip_children = bool(val)
self.stale = True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is only stale if the state changes, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but there are only a few checks anywhere else. This problem will either be solved if we go with a managed attributes meta-class (i.e. traitlets) or slowly as it annoys people.

@tacaswell
Copy link
Member Author

ping @WeatherGod

@jenshnielsen
Copy link
Member

Looks good to me now

WeatherGod added a commit that referenced this pull request Jul 16, 2015
ENH: property if DrawingArea clips children
@WeatherGod WeatherGod merged commit 1444745 into matplotlib:master Jul 16, 2015
@tacaswell tacaswell deleted the enh_offsetbox_clip_children branch July 16, 2015 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants