• 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: Associate, NSView in main window, and disable objects on panel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Associate, NSView in main window, and disable objects on panel


  • Subject: Re: Associate, NSView in main window, and disable objects on panel
  • From: Daniel Staal <email@hidden>
  • Date: Sun, 05 Aug 2007 16:40:44 -0400

--As of August 5, 2007 1:34:59 AM +0200, Claus Atzenbeck is alleged to have said:

(3) Is there a single command to disable all buttons, text fields, etc.
of an NSPanel?

--As for the rest, it is mine.

Not as such. I had a similar problem a while back and was given this code for a protocol:

===========================================

@interface NSView (MYDisablingProtocol)

 - (void)recursivelyDisableSubviews;
 - (void)recursivelyEnableSubviews;

@end

@implementation NSView (MYDisablingProtocol)

-(void)recursivelyEnableSubviews {

if ([self respondsToSelector:@selector(setEnabled:)]) {
[self setEnabled:YES];
[[self subviews] makeObjectsPerformSelector:@selector(recursivelyEnableSubviews)];
}
else {
[[self subviews] makeObjectsPerformSelector:@selector(recursivelyEnableSubviews)];
}


}

-(void)recursivelyDisableSubviews {

if ([self respondsToSelector:@selector(setEnabled:)]) {
[self setEnabled:NO];
[[self subviews] makeObjectsPerformSelector:@selector(recursivelyDisableSubviews)];
}
else {
[[self subviews] makeObjectsPerformSelector:@selector(recursivelyDisableSubviews)];
}

}


@end

===========================================

Note that the above doesn't work on NSTableViews: They don't disable. (This does disable their surrounding scrollview though.) Something similar would probably be useful for you.

Daniel T. Staal


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Associate, NSView in main window, and disable objects on panel
      • From: Claus Atzenbeck <email@hidden>
References: 
 >Associate, NSView in main window, and disable objects on panel (From: Claus Atzenbeck <email@hidden>)

  • Prev by Date: dealloc for cleanup versus freeing memory
  • Next by Date: sortedArrayUsingFunction:context: and other variables
  • Previous by thread: Associate, NSView in main window, and disable objects on panel
  • Next by thread: Re: Associate, NSView in main window, and disable objects on panel
  • Index(es):
    • Date
    • Thread