alexrozanski/PXSourceList

SourceListItem without icon

iamgp opened this issue · 7 comments

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.

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

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

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)

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?
  • 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

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.

No worries. Glad you got it sorted!