FROM : gmc
DATE : Fri Jun 02 20:35:27 2006
Thanks for the help, but I run into another problem implementing your second
idea:
If I override the mouseDown: method, the header is never clickable, even if
canClickInHeaderView == YES.
Anyway, the solution must be to override the mouseDown: method. The
first method
is a little hack and I don't trust it to work forever.
Marc
>
> On 2 juin 06, at 08:47, <email_removed> wrote:
>
>> Hi,
>>
>> I'd like to disabling sorting in an NSTableView to implement a
>> filter like in
>> iTunes. I've found a solution that generally works for me here:
>>
>> http://www.cocoabuilder.com/archive/message/cocoa/2005/9/6/145803
>>
>> But it is still possible to click into the header which flashes shortly. Of
>> course nothing happens, but I'd like to stop the flashing too. How can I
>> realise that?
>
> Stupid ideas:
>
> * First solution (super thrill seeker and stupid)
>
> 1. Write a category of NSTableHeaderView to be able to get/set the
> _reserved4 BOOL
>
> 2. Override the mouseDown: method to do nothing when _reserved4 is
> YES (because the default value is probably NO)
>
> 3. Use the [NSTableView headerView] to access the instance of
> NSTableHeaderView whose behavior you want to modify and set the
> _reserved4 flag to YES.
>
> * Second solution
>
> 1. Write a subclass of NSTableView with a new ivar:
> canClickInHeaderView (default being NO)
>
> 2. Replace NSTableView with your new class
>
> 3. Write a category of NSTableHeaderView and override the mouseDown:
> method. Check that:
>
> [((MyTabView *) [self tableView]) canClickInHeaderView]==NO and just
> returns if it's the case.
>
>
DATE : Fri Jun 02 20:35:27 2006
Thanks for the help, but I run into another problem implementing your second
idea:
If I override the mouseDown: method, the header is never clickable, even if
canClickInHeaderView == YES.
Anyway, the solution must be to override the mouseDown: method. The
first method
is a little hack and I don't trust it to work forever.
Marc
>
> On 2 juin 06, at 08:47, <email_removed> wrote:
>
>> Hi,
>>
>> I'd like to disabling sorting in an NSTableView to implement a
>> filter like in
>> iTunes. I've found a solution that generally works for me here:
>>
>> http://www.cocoabuilder.com/archive/message/cocoa/2005/9/6/145803
>>
>> But it is still possible to click into the header which flashes shortly. Of
>> course nothing happens, but I'd like to stop the flashing too. How can I
>> realise that?
>
> Stupid ideas:
>
> * First solution (super thrill seeker and stupid)
>
> 1. Write a category of NSTableHeaderView to be able to get/set the
> _reserved4 BOOL
>
> 2. Override the mouseDown: method to do nothing when _reserved4 is
> YES (because the default value is probably NO)
>
> 3. Use the [NSTableView headerView] to access the instance of
> NSTableHeaderView whose behavior you want to modify and set the
> _reserved4 flag to YES.
>
> * Second solution
>
> 1. Write a subclass of NSTableView with a new ivar:
> canClickInHeaderView (default being NO)
>
> 2. Replace NSTableView with your new class
>
> 3. Write a category of NSTableHeaderView and override the mouseDown:
> method. Check that:
>
> [((MyTabView *) [self tableView]) canClickInHeaderView]==NO and just
> returns if it's the case.
>
>
| Related mails | Author | Date |
|---|---|---|
| gmc | Jun 2, 08:47 | |
| Stephane Sudre | Jun 2, 16:08 | |
| gmc | Jun 2, 20:35 |






Cocoa mail archive

