• 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: Hiding an NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hiding an NSTextField


  • Subject: Re: Hiding an NSTextField
  • From: Oleg Svirgstin <email@hidden>
  • Date: Sun, 27 Apr 2003 21:25:51 +0300

Hi all,

I would do it like this:

1) subclass NSTextField
2) add to it a BOOL variable "hide" (set it to "NO" in "initWithFrame",
though it seems that a BOOL instance variable is set to NO == 0 by default)
3) override its drawRect to something like

-(void)drawRect:(NSRect)bounds
{
if(hideMe)
{
//if textured window, fill the frame with some degree of gray (???)
//else fill the frame with window background color

//NSWindow has some flags for this that I don't remember from the
top of my head

}
else
{
[super drawRect:bounds];
}
}

4) add to it a setHide:(BOOL)flag and -(BOOL)hide methods
5) import it in the nibs that will make use of such deviated controls and
then use Custom Class tab to make a control to follow this behavior.

By the way, does anybody know a better way to imitate filling a shape with
the textured window background?

I don't think constraining us from doing "stupid things" with the interface
is a good idea.


Regards
Oleg


> From: publiclook <email@hidden>
> Date: Sun, 27 Apr 2003 12:00:04 -0400
> To: Eric Czarny <email@hidden>
> Cc: email@hidden
> Subject: OT: Re: Hiding an NSTextField
>
> Why do so many people in this forum want to hide controls ?
>
> To answer the question, there are no single method solutions for hiding
> controls, and if you ask me that is a good thing.
>
> On Sunday, April 27, 2003, at 02:20 AM, Eric Czarny wrote:
>
>> I am trying to cause an existing text field to hide in a certain event
>> and display the contents behind it, which method should I invoke to go
>> about hiding the text field?
>>
>> Best Regards,
>> Eric Czarny
>>
>> http://www.laterus.net
>> _______________________________________________
>> cocoa-dev mailing list | email@hidden
>> Help/Unsubscribe/Archives:
>> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>> Do not post admin requests to the list. They will be ignored.
> _______________________________________________
> cocoa-dev mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Hiding an NSTextField
      • From: Theodore Petrosky <email@hidden>
References: 
 >OT: Re: Hiding an NSTextField (From: publiclook <email@hidden>)

  • Prev by Date: Reponsiveness of application
  • Next by Date: Re: Reponsiveness of application
  • Previous by thread: OT: Re: Hiding an NSTextField
  • Next by thread: Re: Hiding an NSTextField
  • Index(es):
    • Date
    • Thread