0

I tried to add the custom toolbar to my application. To locate it at the bottom of the window I created one more window and added the toolbar to it:

var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
    contentView = [theWindow contentView],
    bounds = [contentView bounds];
[contentView setBackgroundColor:[CPColor colorWithHexString:@"cecece"]];

///second window to place the toolbar at the bottom
var w2 = [[CPPanel alloc] initWithContentRect:CGRectMake(0, CGRectGetHeight(bounds) - _settings.toolbarSize,
                                                          CGRectGetWidth(bounds), _settings.toolbarSize)
                           styleMask: CPBorderlessWindowMask]
var c2 = [w2 contentView]
[c2 setBackgroundColor:[CPColor colorWithHexString:@"ff0000"]];

///a toolbar
toolbar = [[Toolbar alloc] initWithWindow:w2];

///show window
[theWindow orderFront:self];
[w2 orderFront:self];

It worked properly with the Cappuccino 0.8.1 but does not with the latest one. Only if I either set toolbar for theWindow or init w2 with CPBorderlessBridgeWindowMask it renders as needed.

Does anyone have any idea what is the reason of this behavior?

Nickolay Kondratenko
  • 1,871
  • 2
  • 21
  • 25

0 Answers0