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 !
Attachments:
http://www.ruby-forum.com/attachment/4639/notebook.png
--
Posted via http://www.ruby-forum.com/.
hendra kusuma
2010-Apr-05 08:55 UTC
[wxruby-users] problem with the size of notebook pages
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
On Mon, Apr 5, 2010 at 3:20 PM, Sylvain Dubus <lists at ruby-forum.com>
wrote:
> 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 !
>
> Attachments:
> http://www.ruby-forum.com/attachment/4639/notebook.png
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> wxruby-users mailing list
> wxruby-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wxruby-users
>
--
Suka linux?
Kunjungi blog saya http://penguinroad.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/wxruby-users/attachments/20100405/358d447b/attachment.html>
Sylvain Dubus
2010-Apr-05 12:28 UTC
[wxruby-users] problem with the size of notebook pages
hendra kusuma wrote:> I cannot help with your code > but my code is working > see if this code helps you > good luckThank 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... -- Posted via http://www.ruby-forum.com/.
hendra kusuma
2010-Apr-06 08:06 UTC
[wxruby-users] problem with the size of notebook pages
You''re welcome On Mon, Apr 5, 2010 at 7:28 PM, Sylvain Dubus <lists at ruby-forum.com> wrote:> 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... > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users >-- Suka linux? Kunjungi blog saya http://penguinroad.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/wxruby-users/attachments/20100406/c148c479/attachment.html>