Re: Left and Right Aligned Column in NSTableView
Re: Left and Right Aligned Column in NSTableView
- Subject: Re: Left and Right Aligned Column in NSTableView
- From: Jonathan Wight <email@hidden>
- Date: Mon, 15 Dec 2003 01:04:24 -0600
Actually this looks like the way to do it. As an experiment I just
implemented it this way:
http://homepage.mac.com/jwight/ and grab DateTimeTest.tar.gz (XCode
needed - but binary & source provided)
In the table enter a date in the format "1/1/1 1:1:1" and hit return.
For some reason the field likes to blank itself out (not sure why) but
if you click the table column line and expand/shrink the column you see
the desired effect.
The way it works is I've got a hard coded character sequence in the
format string for the date (so it looks like "%m/%d/%y\t%H:%M:%S" now)
and then in the drawInteriorWithFrame:inView: I'm splitting the cell's
attributedString up into left and right components and drawing each
component flush against the relevent side of the cell.
Maybe there is an easier way to do this - but apart from the
unexplained blanking it seems to work well. Good luck fixing the
blanking!
Jon.
On Dec 15, 2003, at 00:32, Jonathan Wight wrote:
>
You should be able to do it by providing your own
>
NSTextCell/NSActionTextCell subclass and overriding
>
"drawInteriorWithFrame:inView:". Perhaps. ;-)
>
>
Jon.
>
>
On Dec 15, 2003, at 00:07, Paul G. Fitzgerald wrote:
>
>
> Jon,
>
>
>
> If the "Date Received" column in Mail.app is sufficiently widened, the
>
> Date is left aligned, and the time is right aligned. I'd like to do
>
> the same thing with my date column.
>
>
>
> I'm guessing it's not going to be easy... :-)
>
>
>
> Paul
>
>
>
> On Dec 14, 2003, at 11:53 PM, Jonathan Wight wrote:
>
>
>
>> Hi Paul,
>
>>
>
>> What exactly are you trying to accomplish. The "Date Received" column
>
>> in Mail.app looks just like any other column to me...
>
>>
>
>> Jon.
>
>>
>
>> On Dec 14, 2003, at 16:01, Paul G. Fitzgerald wrote:
>
>>
>
>>> I've got a column in an NSTableView that needs to behave like the
>
>>> "Date Received" column in Apple's Mail. I've tried adding a right
>
>>> tab to an NSAttributedString, but it's not working. Am I even on the
>
>>> right track?
>
>>>
>
>>> Thanks,
>
>>>
>
>>> Paul G. Fitzgerald
>
>>> _______________________________________________
>
>>> cocoa-dev mailing list | email@hidden
>
>>> Help/Unsubscribe/Archives:
>
>>> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
>>> Do not post admin requests to the list. They will be ignored.
>
>
[demime 0.98b removed an attachment of type
>
application/pkcs7-signature which had a name of smime.p7s]
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.