# Problem with the size of notebook pages

**URL:** <https://www.ruby-forum.com/t/problem-with-the-size-of-notebook-pages/186338>\
**Category:** wxRuby\
**Created:** [April 5, 2010, 10:20am UTC](https://www.ruby-forum.com/t/problem-with-the-size-of-notebook-pages/186338 "2010-04-05T10:20:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sdesbure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f475e1/32.png) [@sdesbure](https://www.ruby-forum.com/u/sdesbure)\
**Post date:** [April 5, 2010, 10:20am UTC](https://www.ruby-forum.com/t/problem-with-the-size-of-notebook-pages/186338/1 "2010-04-05T10:20:18Z")

</div>

Hi here,

I have to make a school project in wxRuby and since 1-2 weeks, i am  
completely blocked because of a notebook display problem.

I don’t manage to adapt the size of notebook pages with the content. The  
size is completely fixed, and so what is inside is cut. And when I try  
to modify the size, it changes nothing ☹ Here a part of my notebook  
class :

def initialize(parent)  
super(parent, -1, Wx::DEFAULT\_POSITION)  
end

def create\_contact\_page()  
@contacts = Wx::Panel.new(self, :size =\> [-1, 500])  
# the size parameter changes nothing

```
            @contacts_box = Wx::BoxSizer.new(Wx::VERTICAL)

@label_contact_list = Wx::StaticText.new(@contacts, :label =>

```

“Contact list :”)  
@contacts\_box.add(@label\_contact\_list, 1, Wx::ALL, 15)

```
@contacts.set_sizer(@contacts_box)

self.add_page(@contacts, "My contacts")

```

end

I’ve linked the result in attachment.

Thank you for your help !

---

<div class="post-metadata">

**Author:** ![sdesbure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f475e1/32.png) [@sdesbure](https://www.ruby-forum.com/u/sdesbure)\
**Post date:** [April 5, 2010, 10:56am UTC](https://www.ruby-forum.com/t/problem-with-the-size-of-notebook-pages/186338/2 "2010-04-05T10:56:18Z")

</div>

I cannot help with your code  
but my code is working  
see if this code helps you  
good luck

require ‘rubygems’  
require ‘wx’  
class Notebook\_b \< Wx::Frame  
include Wx  
def initialize(parent=nil)  
super parent, -1, “Notebook”, DEFAULT\_POSITION,  
Size.new(600,400),  
DEFAULT\_FRAME\_STYLE  
@statusbar = StatusBar.new(self, -1)  
self.set\_status\_bar(@statusbar)  
@statusbar.set\_status\_text “”  
@notebook\_101 = Notebook.new(self, -1, DEFAULT\_POSITION,  
DEFAULT\_SIZE, NB\_TOP)  
@panel\_102 = Panel.new(@notebook\_101, -1)  
@flexgridsizer\_103 = FlexGridSizer.new( 0, 1, 5, 5 )  
@flexgridsizer\_103.add\_growable\_col 0  
@static\_text\_104 = StaticText.new(@panel\_102, -1, “hello world”,  
DEFAULT\_POSITION, DEFAULT\_SIZE, ALIGN\_LEFT)  
@flexgridsizer\_103.add(@static\_text\_104, 0, Wx::ALL |  
Wx::ALIGN\_LEFT  
| Wx::ALIGN\_TOP | Wx::EXPAND )  
@panel\_102.set\_sizer( @flexgridsizer\_103 )  
@notebook\_101.add\_page @panel\_102, “My Tab”

```
    evt_close{ |event| on_close(event) }
    on_load()
end

def on_close(event)
    event.skip
end

def on_load()
end

```

end

---

<div class="post-metadata">

**Author:** ![sdesbure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f475e1/32.png) [@sdesbure](https://www.ruby-forum.com/u/sdesbure)\
**Post date:** [April 5, 2010, 2:28pm UTC](https://www.ruby-forum.com/t/problem-with-the-size-of-notebook-pages/186338/3 "2010-04-05T14:28:22Z")

</div>

hendra kusuma wrote:

> I cannot help with your code  
> but my code is working  
> see if this code helps you  
> good luck

Thank you Hendra, I tried your code and I had the same problem. So I  
understood that it was not the notebook that was bugging, but something  
else. Finally, the problem is where I add the notebook to my main  
boxsizer.  
I forgot to put the proportion parameter to 1 !! It was at 0 so it took  
the smallest possible place…

---

<div class="post-metadata">

**Author:** ![sdesbure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f475e1/32.png) [@sdesbure](https://www.ruby-forum.com/u/sdesbure)\
**Post date:** [April 6, 2010, 10:10am UTC](https://www.ruby-forum.com/t/problem-with-the-size-of-notebook-pages/186338/4 "2010-04-06T10:10:29Z")

</div>

You’re welcome
