notebook fail

Forums » General discussion
     » notebook fail

2008/07/08 21:25

Hello,

I am using notebooks fine, but in one instance I've spent about 2 hours trying different combinations but the notebook is never rendered.

    // works:
    //var toolbarHbox = new DlHbox({ parent: this.topVbox});
    //var testLabel = new DlLabel({ parent: toolbarHbox, label: "test" });

    // fail
    var toolbarHbox = new DlHbox({ parent: this.topVbox});
    this.toolbarNotebook = new DlNotebook({ parent: this.toolbarHbox });
    this.toolbarNotes = new DlContainer({ parent: this.toolbarNotebook });
    this.testLabel = new DlLabel({ parent: this.toolbarNotes,label:"test"});
    this.toolbarNotebook.showPane(0);
Why would the notebook fail?

Does it matter how many containers and layouts are before it?



2008/07/08 22:04

I've noticed that if I use a container instead of a notebook it works fine.

The examples using notebook use the setInnerSize() method. This makes the notebook viewable, but I don't want to specify the size as I want it to take up the full size of the layout. Am I missing something simple?


Thanks.



2008/07/09 06:17

Here is a simple test case that shows the problem:

(I thought the DlHbox by default took up all horizontal space. I thought that the layout with {pos: "top", fill: "*"} would take all available space too.

var box = new DlVbox({ parent: getDocCanvas(), borderSpacing: 3 });
var b = new DlHbox({ parent: box });
var l = new DlLayout({ parent: b });
var e1 = new DlEntry({  });
l.packWidget(e1, {pos: "top", fill: "*"});
var e2 = new DlEntry({ parent: box, size: 10 });

I've tried lots of combinations and I haven't found the right one yet.

(I'm sure it exists :-)

P.S. My goal is simply to create a few DlEntry objects that auto-resize to the width of their container.

Any hints would be appreciated.

Thanks!

2008/07/09 06:43

I see my previous post is a different issue. It has to do with <input> elements being inline,when I need the display to be 'block'.

The first post issue I'm still confused about.


2008/07/09 08:57

I finally solved it.

I simply had to hard code a layout height. I had thought that the layout would walk through its children to find out what their heights were. Apparently it doesn't always do this?

Thanks.