 |
 |
Got them low-down dirty NSView blues...
|
 |
|
 |
|
Professional Poster
Join Date: Sep 2000
Location: San Francisco
Status:
Offline
|
|
How do I switch out views in a window. I basically have several different views that I want to display depending on buttons pressed in the toolbar. The views should just replace one another in the window. How do I switch them?
kman
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Oct 2000
Status:
Offline
|
|
Originally posted by kman42:
<STRONG>How do I switch out views in a window. I basically have several different views that I want to display depending on buttons pressed in the toolbar. The views should just replace one another in the window. How do I switch them?
kman</STRONG>
I believe you're looking for setContentView? Just pass it any view and it should update the window.
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Sep 2000
Location: San Francisco
Status:
Offline
|
|
If I don't want everything in the window to change, but just some items can I just group them in a custom view and then send the custom view the setContentView or does it only work on windows?
I just checked for a setContentView in NSView and couldn't find it so I guess the answer is no.
Do I just have to release the views I want to disappear and instantiate new views programmatically when I want them to appear?
kman
edit-answered my own question
[ 04-21-2002: Message edited by: kman42 ]
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Mar 2001
Status:
Offline
|
|
From your description, it sounds like the easiest thing is to just use an NSTabView, and set it to not display the tabs (setTabViewType: NSNoTabsNoBorder). You can then programmatically switch between the views by calling any of the various selectTabViewItem methods.
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Sep 2000
Location: San Francisco
Status:
Offline
|
|
Originally posted by Porfiry:
<STRONG>From your description, it sounds like the easiest thing is to just use an NSTabView, and set it to not display the tabs (setTabViewType: NSNoTabsNoBorder). You can then programmatically switch between the views by calling any of the various selectTabViewItem methods.</STRONG>
I like that idea. I'm also curious how people get their windows to 'slide' from view to view. For instance, when you click on a preference button in the System Prefs.
kman
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Feb 2001
Location: Germany
Status:
Offline
|
|
Originally posted by kman42:
<STRONG>
I like that idea. I'm also curious how people get their windows to 'slide' from view to view. For instance, when you click on a preference button in the System Prefs.
kman</STRONG>
have a look at nswindow's setFrame:display:animate: -- use "YES" for "animate"... 
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status:
Offline
|
|
And if you still need help, look at the freely available OmniAppKit source code -- we do the animating resizing thing in OAPreferenceController.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |