• 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: Theodore Petrosky <email@hidden>
  • Date: Sun, 27 Apr 2003 13:06:27 -0700 (PDT)

It really depends on the interface. I accomplished
something similar by creating a NSTabView with no tabs
so I could programatically go from one tab to the
other. Then I put the controls on the tabs so I could
'hide and show' them.

Maybe not the most elegant method, but it works.

Just adding my 2 cents,

Ted


--- Oleg Svirgstin <email@hidden> wrote:
> 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.

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
_______________________________________________
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: Olaf van Oudenallen <email@hidden>
    • Big grinding memory leak?
      • From: Martin Häcker <email@hidden>
References: 
 >Re: Hiding an NSTextField (From: Oleg Svirgstin <email@hidden>)

  • Prev by Date: rotating an NSImage ?
  • Next by Date: Re: converting text input in any encoding to unicode
  • Previous by thread: Re: Hiding an NSTextField
  • Next by thread: Big grinding memory leak?
  • Index(es):
    • Date
    • Thread