Skip to content
This repository has been archived by the owner on Jan 18, 2023. It is now read-only.

SourceListItem without icon #47

Closed
iamgp opened this issue Sep 5, 2014 · 7 comments
Closed

SourceListItem without icon #47

iamgp opened this issue Sep 5, 2014 · 7 comments

Comments

@iamgp
Copy link

iamgp commented Sep 5, 2014

Is there an easy way to remove the icon for the list item? I've tried creating my own listitem subclass but can't seem to get it right!

Thanks.

@iamgp
Copy link
Author

iamgp commented Sep 5, 2014

In fact, what's the best way to create our own style for the listitem?

Even though I have this in IB:

I get this when I run the app (I fixed the error i was getting):

(The height is normal height, not my higher height, and positioning is off)

Thanks

@alexrozanski
Copy link
Owner

Is the Source List being correctly sized in its parent view in Interface Builder?

@iamgp
Copy link
Author

iamgp commented Sep 5, 2014

Yes.

On Fri, Sep 5, 2014 at 3:21 AM, Alex Rozanski notifications@github.com
wrote:

Is the Source List being correctly sized in its parent view in Interface Builder?

Reply to this email directly or view it on GitHub:
#47 (comment)

@iamgp
Copy link
Author

iamgp commented Sep 5, 2014

It must be something to do with the height of the row.

If I have this in IB:


I still get this in the app:

Why:

  • is the dynamic text (i.e. Texting Project) changing location, and
  • why is the row height changing back to normal height?

@alexrozanski
Copy link
Owner

  • Is the dynamic label set to the cell's textField outlet? If so, I believe that NSTableCellView will automatically position the text field for you (as well as applying the correct styling).
  • You'd have to set the row height using NSOutlineView's -setRowHeight: method

@iamgp
Copy link
Author

iamgp commented Sep 5, 2014

Ok, so I got it working.

For future reference (mostly for myself!), you can either set all row heights by:

[self.sourceList setRowSizeStyle:NSTableViewRowSizeStyleCustom];
[self.sourceList setRowHeight:40.0];

or dynamically by calling, then following the same stuff as the example using [aSourceList levelForItem:item]:

- (CGFloat)sourceList:(PXSourceList *)aSourceList heightOfRowByItem:(id)item

Thanks for your help.

@iamgp iamgp closed this as completed Sep 5, 2014
@alexrozanski
Copy link
Owner

No worries. Glad you got it sorted!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants