Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Clicking NSTable column ->action

Clicking NSTable column ->action
Thread Tools
Mac Enthusiast
Join Date: Sep 2000
Location: Vermont, USA
Status: Offline
Reply With Quote
May 1, 2002, 06:28 PM
 
I have read a few posts regarding clicking table columns in an NSTable view and having that action call a method (like sort the table), but I still can't figure out how to do this. I am pretty new at programming so I was wondering if someone could post an example of the code used to make it so that a method gets called when the user clicks a column in an NSTable. I posted a similar thread looking at my code, but I am still stuck. I am programming in Cocoa Java, but if you can post it in Obj-C that is fine too.
     
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
May 2, 2002, 08:28 AM
 
In your delegate, implement this:

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
- (void)tableView NSTableView*)tableView didClickTableColumn NSTableColumn *)tableColumn
</font>[/code]

actually... on the java side of the bridge, it's just...

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
public abstract void tableViewDidClickTableColumn( NSTableView tableView, ,NSTableColumn tableColumn)
</font>[/code]
(Hmm... seems to be an error in the docs here: it has a period inbetween tableView and NSTableColumn instead of a comma)

Sent at the time the mouse subsequently goes up and tableColumn has been "clicked" without having been dragged anywhere.

HTH,
F-bacher
     
Mac Enthusiast
Join Date: Sep 2000
Location: Vermont, USA
Status: Offline
Reply With Quote
May 2, 2002, 09:22 PM
 
Thanks! Works great.

Just what I needed.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:52 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2