Re: growing an NSView?
Re: growing an NSView?
- Subject: Re: growing an NSView?
- From: Rainer Brockerhoff <email@hidden>
- Date: Thu, 8 Nov 2001 09:56:25 -0200
Date: Wed, 7 Nov 2001 15:12:46 -0800
From: email@hidden
I would like to have an arrow at the bottom of my window such that when
pressed will point down and the window will extend, and I can put a text
view within the extend part. I've seen this in many applications. How
do they do this? Do they extend the view? Do they create another view
below the current view?
I suppose you mean a disclosure triangle or button? Have a look at my
XRay application (the Permissions panel) to check if that's what you
want.
If yes, there's no easy support either for the triangle/button itself
or for the growing/shrinking part. I can go into more detail, but
briefly, when growing, I first grow the window and then insert a new
view into the empty part; when shrinking, I remove the view and then
shrink the window.
There're also several tricks to get the proper behavior for the
button or triangle. Carbon has these controls built-in, but Cocoa
doesn't.
--
Rainer Brockerhoff <email@hidden>
Belo Horizonte, Brazil
"Originality is the art of concealing your sources."
http://www.brockerhoff.net/ (updated Oct. 2001)