Skip navigation.
 
mlRe: How to simulate a Mouse Click on a row in NSTableView
FROM : Andrew Farmer
DATE : Fri Jan 11 04:39:13 2008

On 10 Jan 08, at 18:19, DongRuchan wrote:
> hi,
> I have a problem :how to simulate a Mouse Click on a row in 
> NSTableView


I suspect you're asking the wrong question. It is rarely the case that 
you actually need to synthesize user-interface events. There are 
usually much cleaner (and more flexible) ways of getting the same 
effect which don't depend on details of the user interface.

> the specific condition is that
>  there are two tables in a window, we can image it is a phonebook.
> in the window, the left table is the groupList, and the right is the 
> userList.
>
> I use a example to show my question
>          in the groupList I have several group such as
>                      frends
>                      family
>                      teacher
> and so on.
>        we click frends row,we can get it's members  in the userList .
>
> How to  simulate "click frends row" ,and the userList table to show 
> freds's members?


The question you probably intend to ask here is:

  "How can I cause an object in a master-detail interface to be 
selected?"

If you're working with Cocoa Bindings and NSObjectController (or its 
subclass NSArrayController), the solution is pretty straightforward: 
the class supports a number of methods to manipulate the selection.

If you're trying to roll your own implementation of something similar, 
all bets are off. You can manipulate the selections in a table view 
manually - the relevant method is pretty obvious - but getting other 
views to reflect this accurately is your responsibility (and is likely 
to be messy).

Related mailsAuthorDate
mlHow to simulate a Mouse Click on a row in NSTableView DongRuchan Jan 11, 03:19
mlRe: How to simulate a Mouse Click on a row in NSTableView Ron Fleckner Jan 11, 04:32
mlRe: How to simulate a Mouse Click on a row in NSTableView Andrew Farmer Jan 11, 04:39