• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Selectable and editable spreadsheet-like matrix
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Selectable and editable spreadsheet-like matrix


  • Subject: Selectable and editable spreadsheet-like matrix
  • From: Stefan Urbanek <email@hidden>
  • Date: Mon, 3 Oct 2005 12:10:04 +0200

Hi,

I am working on an application where I would like to have a spread- sheet like matrix (with predefined fixed size). Hehaviour of the matrix should be:
- single click - select cells
- double click - edit cell contents


I prepare the matrix:

        matrix = [[NSMatrix alloc] initWithFrame:rect];

        [matrix setMode:NSListModeMatrix];
        [matrix setAllowsEmptySelection:YES];
        [matrix setSelectionByRect:YES];
        [matrix setTarget:self];
        [matrix setAction:@selector(cellSelectionChanged:)];
        [matrix setDoubleAction:@selector(cellDoubleClicked:)];

Cells areset as [cell setEditable:NO].

Now on double click I do:

- (void)cellDoubleClicked:(id)sender
{
    NSLog(@"Cell doubleclicked");
    [[matrix selectedCell] setEditable:YES];
    [matrix selectText];
}

With this, the cell is editable on second click, not immediately on the first double click. Note that I have not yet implemented removal of editable cell after editing is finished.

What is the proper way of achieving the goal? Where I can find some examples?

Thank you,

Stefan Urbanek

_______________________________________________
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


  • Prev by Date: Re: XML parser for objective C
  • Next by Date: Re: how to implement equivalent of -[NSTableView _getFullyFormedCellAtColumn:row:]?
  • Previous by thread: Re: XML parser for objective C
  • Next by thread: Re: how to implement equivalent of -[NSTableView _getFullyFormedCellAtColumn:row:]?
  • Index(es):
    • Date
    • Thread