Re: dynamic GUI, how to?
Re: dynamic GUI, how to?
- Subject: Re: dynamic GUI, how to?
- From: Scott Thompson <email@hidden>
- Date: Tue, 13 Jun 2006 14:23:52 -0500
On Jun 13, 2006, at 1:58 PM, Peter Lau wrote:
I am new to Cocoa so if this' been discussed or documented, some
URL's should be enough and welcome to get me going.
Here's the my problem:
I need to implement a GUI that I don't think (correct if I am
wrong) I can layout the whole thing ahead of time...
It's kind of like the XCode's Preferences dialog box. I will have
different categories for the user to choose from first. Then in
each categories, the user will see a different set of GUI.
I have been working through some Cocoa books but the examples I
have seen are mostly static GUI layout, linking controllers to
controls, etc. using IB.
Since I have quite of number of categories, I don't think I want to
layout everything in one nib window and write a lot of show and
hide calls depends on which category is chosen.
And I don't want to do a once size fit all approach. So, each pane
from each category will need to resize the window to make it looks
best.
Is there a known or common design pattern for this type of GUI?
Sure.
One way is to put each of your panes into a view, each of which is in
a nib file (they might be in the same nib file and they might be in
different ones). Each pane also gets a separate controller. Then
your prefs code (or whatever) will load the nib file(s) that contain
the panes using outlets (usu. through the files owner) to connect the
controllers to their panes. You can add all the panes into a single,
borderless NSTabPane that you use to switch between the views.
(the sub-views can resize with the NSTabPane as well. You might have
to manually adjust their size when you first put them in the
NSTabPane, but the correct config of struts and springs should allow
them to resize automatically thereafter.
Scott
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden