Re: NSTableView - how to select text when editing a column?
Re: NSTableView - how to select text when editing a column?
- Subject: Re: NSTableView - how to select text when editing a column?
- From: Matt Neuburg <email@hidden>
- Date: Fri, 07 Jul 2006 07:50:32 -0700
- Thread-topic: NSTableView - how to select text when editing a column?
On Fri, 7 Jul 2006 09:36:57 +0200, "Roni Music" <email@hidden> said:
>I'm using the NSTableView and everything is working fine.
>
>To edit a specific row/column, I do:
>
> int theRow = [mMyTableView selectedRow];
> [mMyTableView editColumn:0 row:theRow withEvent:nil select:YES];
>
>This displays the edit field and and I can type some new text, fine.
>
>However I would like not to have the entire text selected but just a
>part of it.
>
>I'm displaying file names such as:
>"AFileName.mp3 "and I would like just the"AFileName" portion selected
>and not the file extension ".mp3"
>
>I've googled a lot for a solution but can't find any.
Sometimes just walking the docs is better than googling. You are, as you
say, using an NSTableView, so start there. An NSTableView is an NSControl.
An NSControl has a currentEditor. The currentEditor is an NSTextView. An
NSTextView has a setSelectedRange: method.
m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden