Of course that's possible
You just make a new class like myCoolView.j
_______________________________________________________
@implementation myCoolView : CPView
{
}
- (void)initWithFrame:(CGRect)aFrame
{
self = [super initWithFrame:aFrame];
if (self) {
// For example
[self setBackgroundColor:[CPColor
colorWithHexString:@"003366"];
}
return self
}
@end
_______________________________________________________
Then in your AppController you first have to import that file with
@import "myCoolView.j"
and then just add it to you subview like
var myCoolView = [[myCoolView alloc] initWithFrame:CGRectMake(10, 10,
100, 100);
[contentView addSubview:myCoolView];
Hope that helps.
Elias
On 24 Nov., 18:25, Nahuel Chaves <
nahuel.cha...@gmail.com> wrote:
> i was thinking... creating a CPObject named windowManager or something like
> that.. and creating the views once is "init" but in different methods...
> something like
> -(id) createView1
> {
> //add the subviews
>
> }
>
> and then show them by the code you wrote...
>
> makes sense?
>
> 2009/11/24 Nahuel Chaves <
nahuel.cha...@gmail.com>
>
>
>
> > Nice way of seeing it :) but i still have a question... can i create views
> > with its subviews in a separate file? im trying to make my code clean.
>
> > 2009/11/24 Elias <
elias....@gmail.com>
>
> > You could create some views with the same size and same position like
> >> "a stack of paper".
> >> Then with your sidebar's button actions you decide which views should
> >> hide and which view should show, for example
>
> >> - (void)showTheFirstView:(id)sender
> >> {
> >> [view1 setHidden:NO];
> >> [view2 setHidden:YES];
> >> [view3 setHidden:YES];
> >> }
>
> >> and so on...
>
> >> On 24 Nov., 03:05, NahuelChaves <
nahuel.cha...@gmail.com> wrote:
> >> > Someone knows how to create multiple views to show on a single content
> >> > view.. changing between them by the sidebar menu. Im learning
> >> > cappuccino but this is difficult!
>
> >> --
>
> >> You received this message because you are subscribed to the Google Groups
> >> "Cappuccino & Objective-J" group.
> >> To post to this group, send email to
objec...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >>
objectivej+...@googlegroups.com<objectivej%2Bunsubscribe@googlegrou
ps.com>
> >> .