Re: NSMatrix: does it have an delegate method...

  • I believe you will have to use a borderless buttoncell and use target/
    action to catch the clicks.

    As for color, that's another problem that I'm fighting with right
    now. There are examples of a colored button on the web but making the
    custom cell work in a matrix seems non-trivial. I would be grateful
    for any tips on this too ;-)

    http://danieldickison.com/blog/index.php?/archives/10-Making-Cocoa-
    buttons-look-happy.html

    Bertil

    > I have a NSMatrix of NSTextFieldCell (uneditable "System Font Text"
    > type)
    > displayed on window.
    >
    > I want to change the color of a cell when the user clicks on any cell.
    >
    > How do I achieve this?
    >
    > Is there any delegate method that can be implemented, that tells
    > when a cell
    > is clicked (selected).
    >
    > I have gone thru the docs and couldn't find a way.
  • Thanks for the reply.

    I want to only change the background color of the cell in matrix and
    fighting with it now. Nothing seems to work. Have posted it also separately
    on cocoa-dev.

    Can I override -mouseDown() method of the matrix in any way to know if the
    user selected any cell.

    Thanks again.

    Wishes.
    Navneet

    -----Original Message-----
    From: cocoa-dev-bounces+navneet=<diskdoctors.com...>
    [mailto:cocoa-dev-bounces+navneet=<diskdoctors.com...>] On Behalf
    Of Bertil Holmberg
    Sent: Sunday, January 06, 2008 3:09 AM
    To: <cocoa-dev...>
    Subject: Re: NSMatrix: does it have an delegate method...

    I believe you will have to use a borderless buttoncell and use target/
    action to catch the clicks.

    As for color, that's another problem that I'm fighting with right
    now. There are examples of a colored button on the web but making the
    custom cell work in a matrix seems non-trivial. I would be grateful
    for any tips on this too ;-)

    http://danieldickison.com/blog/index.php?/archives/10-Making-Cocoa-
    buttons-look-happy.html

    Bertil

    > I have a NSMatrix of NSTextFieldCell (uneditable "System Font Text"
    > type)
    > displayed on window.
    >
    > I want to change the color of a cell when the user clicks on any cell.
    >
    > How do I achieve this?
    >
    > Is there any delegate method that can be implemented, that tells
    > when a cell
    > is clicked (selected).
    >
    > I have gone thru the docs and couldn't find a way.
  • on 1/5/08 2:50 PM, <navneet...> purportedly said:

    > I want to only change the background color of the cell in matrix and
    > fighting with it now. Nothing seems to work. Have posted it also separately
    > on cocoa-dev.
    >
    > Can I override -mouseDown() method of the matrix in any way to know if the
    > user selected any cell.

    You could use bindings. Also, considering that bindings work, there must be
    an observable property that will give you the current selected cell or at
    least the coordinates (row/column).

    Best,

    Keary Suska
    Esoteritech, Inc.
    "Demystifying technology for your home or business"
previous month january 2008 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today