epreston/PSTreeGraph

customizing the leaf view

pwinward opened this issue · 5 comments

Thanks for the great work you've put into this. I have a couple observations.

In my leaf view subclass, I tried setting the fill color within initWithFrame but found that it wasn't being called. InitWithCoder is though. Additionally, although the fill color was being set, it was later being reset by configureDetaults in PSBaseLeafView.m because of a call from within awakeFromNib.

Thank you for the feedback :-)

I think that is an issue i created with the way I implemented that. I was having some issue a year ago and the call was placed in "awakeFromNib". The code should be redone to use UIKit methods to set display properties (where possible), and configuration should take place in InitWithCoder / initWithFrame calls like:

    - (id) initWithFrame:(CGRect)frame {
        if ((self = [super initWithFrame:frame])) {

            // Configure stuff here

        }
        return self;
    }

Get back to you shortly.

Removed the awakeFromNib code for an implementation of NSCoding. Updated the examples.

This should fix things up and make it a little more clear. It is also a step towards an interface builder plugin that will allow designers to configure the presentation of the control directly. Tell me what you think. :-)

Almost forgot, added a selectionColor property to the LeafView. Yellow might not be everyones cup of tea. :-)

I can tell by your silence that you won't be happy until we have an interface builder plugin. I won't be happy until we have an interface builder plugin. We need an interface builder plugin.

IBPlugin's are no longer supported. Must have missed the memo...

Well, that stops that then. I guess the only use for NSCoding will be to capture display state preferences if you make that available to users.

Thanks for responding so quickly and making the changes. I'll try out the latest release when I get the chance.