• 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
Re: Show/Hide columns in NSTableView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Show/Hide columns in NSTableView?


  • Subject: Re: Show/Hide columns in NSTableView?
  • From: Andreas Mayer <email@hidden>
  • Date: Thu, 27 Jul 2006 23:17:20 +0200


Am 27.07.2006 um 10:37 Uhr schrieb Fredrik Olsson:

Is there a more elegant solution to letting the user (And programatically) toggle columns on and off?

Hm. I do have something like this. Not sure I'd call it an *elegant* solution though.


It involves subclassing NSTableView *and* NSTableColumn and it uses two private methods of NSTableView - since I couldn't get autosaving to work properly without them.

Here are the interfaces:

@interface AMRemovableColumnsTableView : NSTableView {
	IBOutlet id obligatoryColumnIdentifiers; // NSArray
	NSSet *allTableColumns;
	BOOL am_respondsToControlDidBecomeFirstResponder;
}

- (NSSet *)allTableColumns;

- (NSSet *)visibleTableColumns;

- (NSSet *)hiddenTableColumns;

- (NSSet *)obligatoryTableColumns;

- (BOOL)hideTableColumn:(NSTableColumn *)column;

- (BOOL)showTableColumn:(NSTableColumn *)column;

- (BOOL)isObligatoryColumn:(NSTableColumn *)column;

@end


@interface AMRemovableTableColumn : NSTableColumn { IBOutlet AMRemovableColumnsTableView *mainTableView; }

- (AMRemovableColumnsTableView *)mainTableView;
- (void)setMainTableView:(AMRemovableColumnsTableView *) newMainTableView;


- (BOOL)hidden;
- (void)setHidden:(BOOL)flag;

@end


If anyone is interested, I'm gonna write a sample app and put the code on my website.



Andreas _______________________________________________ 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
  • Follow-Ups:
    • Re: Show/Hide columns in NSTableView?
      • From: Corbin Dunn <email@hidden>
    • Re: Show/Hide columns in NSTableView?
      • From: Fredrik Olsson <email@hidden>
References: 
 >Show/Hide columns in NSTableView? (From: Fredrik Olsson <email@hidden>)

  • Prev by Date: Re: How do I pattern an image in a view w/o "scrolling"?
  • Next by Date: Re: NSDatePicker delegate
  • Previous by thread: Show/Hide columns in NSTableView?
  • Next by thread: Re: Show/Hide columns in NSTableView?
  • Index(es):
    • Date
    • Thread