Re: Changing control layouts
Re: Changing control layouts
- Subject: Re: Changing control layouts
- From: Guy English <email@hidden>
- Date: Wed, 16 Feb 2005 11:45:26 -0500
Hi,
Traditionally Cocoa inspectors have been implemented as Nib files. You
work out what class you're looking at and load up the matching
inspectors nib file. In a number of my projects inspectors were
plug-ins, seperate from the main app. Write your inspector nib like
you would a normal-ish Cocoa app - a controller object with outlets
and actions, etc. The file's owner is the object in your main app
responsible for managing the inspectors window. The Nib approach is
nice because it's dynamic - given the class name of the object you're
inspecting you can build a file name and load a nib / plugin. If that
fails just put up a blank "no inspector" nib. That way as you add
objects to your app you can add nibs independently and as you see fit.
A second approach would be to make a borderless tabview and in each
tab define the inspector for a different object. This is lame in a
number of ways - it's not as dynamic, you'll need to map object class
-> tab index (not a biggy granted), and the controller will get
bloated dealing with inspectors for each of your object classes. That
said, if you've only got two or three inspectable object classes and
you're pretty sure that's not going to change the tab method is
probably quicker in that it requires much less infrastructure.
Don't do the hide, move, show thing. It'll drive you nuts and your
layout will never look as good as if you'd designed it in IB.
I'm not clear on if you have properties shared between your objects or
not. If you do it'd be a pain to replicate all that in each Nib. In
this case you can crib from IB - it's got inspector pages per property
set. The size page, for example, is used across views, while the, uh
... first page (no Mac right now) is used for object specfic
properties. If you can group your properties into logical sets like
this then you'll end up with both a slick code design and a slick UI.
Note that there's nothing saying the pages have to be seperate - you
can just stack the property editing views in the inspector window.
Take care,
Guy
_______________________________________________
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