Forum: wxRuby WxNotebook

95c7086804620edee39f58228f70c4c1?d=identicon&s=25 Philip Stephens (philipcs)
on 2010-03-17 05:24
(Received via mailing list)
I am trying to create a notebook with tabs but have failed.  What do I
need to do get the tabbed notebook to display properly?  Thanks.

require 'rubygems'
require 'wx'
require 'ratio1.rb'

class MyApp < Wx::App

  def on_init
    @main_win = InputSubclass.new
    @nbpLiquidity = Liquidity_sc.new
    @nbpActivity = Activity_sc.new

                @m_notebook = Wx::Notebook.new(@main_win, 1000)
    @m_notebook.add_page(@nbpLiquidity, "test1")
    @m_notebook.add_page(@nbpActivity, "test2")

    @main_win.show
  end #def
end # class

MyApp.new.main_loop

====================
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwindows.org/wxxrc" version="2.3.0.1">
  <object class="wxFrame" name="frmInput" subclass="InputSubclass">
    <style>wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL</style>
    <size>510,310</size>
    <title>Data Entry</title>
  </object>
  <object class="wxFrame" name="frmLiquidity" subclass="Liquidity_sc">
    <style>wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL</style>
    <size>500,300</size>
    <title>Liquidity Ratios</title>
  </object>
  <object class="wxFrame" name="frmActivity" subclass="Activity_sc">
    <style>wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL</style>
    <size>500,300</size>
    <title>Activity Ratios</title>
  </object>
  <object class="wxFrame" name="frmLeverage" subclass="Leverage_sc">
    <style>wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL</style>
    <size>500,300</size>
    <title>Leverage Ratios</title>
  </object>
  <object class="wxFrame" name="frmPerformance" subclass="Perf_sc">
    <style>wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL</style>
    <size>500,300</size>
    <title>Performance Ratios</title>
  </object>
  <object class="wxFrame" name="frmValuation" subclass="Valuation_sc">
    <style>wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL</style>
    <size>500,300</size>
    <title>Valuation Ratios</title>
  </object>
</resource>
2aa32559134aa3d596fb749f8ffccde7?d=identicon&s=25 hendra kusuma (Guest)
on 2010-03-17 07:24
(Received via mailing list)
I am not an expert but I'll try to help

according to my experiences, you can add a panel as page in notebook
I don't know what object Liquiduty_sc is
but if it is a panel then it should be ok
95c7086804620edee39f58228f70c4c1?d=identicon&s=25 Philip Stephens (philipcs)
on 2010-03-17 07:41
hendra kusuma wrote:
> I am not an expert but I'll try to help
>
> according to my experiences, you can add a panel as page in notebook
> I don't know what object Liquiduty_sc is
> but if it is a panel then it should be ok

I got my code to work.  Thanks for the help.

Philip
This topic is locked and can not be replied to.