alexrozanski / PXSourceList

Source List control for the Mac
Other
639 stars 77 forks source link

SourceListItem without icon #47

Closed iamgp closed 10 years ago

iamgp commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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

iamgp commented 10 years ago

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: https://github.com/Perspx/PXSourceList/issues/47#issuecomment-54574381

iamgp commented 10 years ago

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:

alexrozanski commented 10 years ago
iamgp commented 10 years ago

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.

alexrozanski commented 10 years ago

No worries. Glad you got it sorted!