Setting Vertical Alignment in ListIconGadget

Mac OSX specific forum
simberr
User
User
Posts: 46
Joined: Sun Jun 10, 2018 12:54 pm

Setting Vertical Alignment in ListIconGadget

Post by simberr »

I am using the Cocoa procedure in the Tips and Tricks section to set the row height of my ListIconGadget items and this works well.

However, the text is aligned to the top of the cell and does not look right. I have been attempting to find the Cocoa function to specify the Vertical Alignment of the rows but cannot work out what I need.

Please will someone advise me the cocoa calls necessary to set the vertical alignment of the rows?

Thanks in advance.
User avatar
Shardik
Addict
Addict
Posts: 1989
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: Setting Vertical Alignment in ListIconGadget

Post by Shardik »

The easiest way is to utilize the internal Cocoa method _setVerticallyCentered:. The drawback of using this method is that it could simply disappear without warning in future MacOS releases and its use may lead to a rejection in Apple's AppStore!

For the implementation of _setVerticallyCentered: you may take a look into two of my code examples:
viewtopic.php?f=19&t=66854&start=5
viewtopic.php?f=19&t=67017&start=4
simberr
User
User
Posts: 46
Joined: Sun Jun 10, 2018 12:54 pm

Re: Setting Vertical Alignment in ListIconGadget

Post by simberr »

Shardik

Thank you! I have been hunting for the CocoaMessage in the Apple documentation and couldn't find it!

Why are you worried about the function being acceptable to Apple? Is it already deprecated? Have they suggested an alternative?

In the meantime I will use this as it works exactly as I want.

Thanks again.

Simon.
Post Reply