FROM : Kyle Sluder
DATE : Sat Feb 02 20:16:22 2008
On Feb 2, 2008 2:05 PM, Diez B. Roggisch <<email_removed>> wrote:
> So the first question is: to make a re-usable view/panel, do I need to
> create a IB Palette? I'd rather avoid that for obvious reasons (I doubt
> I ever need that control again) - but will, if I have to.
Nope. You would typically create a new nib that contained just your
view (no windows, just the view) and place your controls in it. Your
window controller (most likely) will be responsible for loading this
nib (which instantiates a new view each time) and placing its view in
the window's view hierarchy.
>
> The second question: once I found a way to create a panel, the question
> of the number of instances arises.
>
> Granted, my robot wont magically grow any new motors over night, so I
> _could_ go and instantiate a panel & controller for each of them.
> However, I was wondering if there is a way to instantiate a panel + a
> controller. As said above, providing a controller with a new
> data-backing object seems to be easy, but I've got no idea if and how I
> can re-create the bindings for my new panel instance.
If you're going to go the multiple-window route (instead of multiple
views in one window), then you should be able to bind through the
File's Owner proxy object without issue. There should be no need to
recreate any bindings.
HTH,
--Kyle Sluder
DATE : Sat Feb 02 20:16:22 2008
On Feb 2, 2008 2:05 PM, Diez B. Roggisch <<email_removed>> wrote:
> So the first question is: to make a re-usable view/panel, do I need to
> create a IB Palette? I'd rather avoid that for obvious reasons (I doubt
> I ever need that control again) - but will, if I have to.
Nope. You would typically create a new nib that contained just your
view (no windows, just the view) and place your controls in it. Your
window controller (most likely) will be responsible for loading this
nib (which instantiates a new view each time) and placing its view in
the window's view hierarchy.
>
> The second question: once I found a way to create a panel, the question
> of the number of instances arises.
>
> Granted, my robot wont magically grow any new motors over night, so I
> _could_ go and instantiate a panel & controller for each of them.
> However, I was wondering if there is a way to instantiate a panel + a
> controller. As said above, providing a controller with a new
> data-backing object seems to be easy, but I've got no idea if and how I
> can re-create the bindings for my new panel instance.
If you're going to go the multiple-window route (instead of multiple
views in one window), then you should be able to bind through the
File's Owner proxy object without issue. There should be no need to
recreate any bindings.
HTH,
--Kyle Sluder
| Related mails | Author | Date |
|---|---|---|
| Diez B. Roggisch | Feb 2, 20:05 | |
| Kyle Sluder | Feb 2, 20:16 | |
| Diez B. Roggisch | Feb 2, 20:25 | |
| Kyle Sluder | Feb 2, 21:25 |






Cocoa mail archive

