Hi. I''m back. Unfortunately I can''t get xrcise working. Here
is the
sample xrc file and the resulting error messages:
=============== TestWxFb.xrc ========================================<?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="MyFrame2"
subclass="minFrame">
<style>wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL</style>
<size>500,300</size>
<title>Minimal</title>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<option>0</option>
<flag>wxALL|wxALIGN_CENTER_HORIZONTAL</flag>
<border>5</border>
<object class="wxStaticText"
name="m_staticText12">
<label>Test</label>
</object>
</object>
<object class="sizeritem">
<option>1</option>
<flag>wxEXPAND</flag>
<border>5</border>
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<border>5</border>
<object class="wxStaticText"
name="m_staticText13">
<label>Username</label>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<border>5</border>
<object class="wxTextCtrl"
name="m_textCtrl4">
<value></value>
<maxlength>0</maxlength>
</object>
</object>
</object>
</object>
<object class="sizeritem">
<option>1</option>
<flag>wxEXPAND</flag>
<border>5</border>
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<border>5</border>
<object class="wxStaticText"
name="m_staticText14">
<label>MyLabel</label>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<border>5</border>
<object class="wxTextCtrl"
name="m_textCtrl5">
<value></value>
<maxlength>0</maxlength>
</object>
</object>
</object>
</object>
</object>
</object>
</resource>
========================================================================
xxx:~/Desktop/Eyes$ xrcise -o TestWxFb.rb TestWxFb.xrc
/home/myhome/gems/gems/wx_sugar-0.1.22/lib/wx_sugar/xrc/outputter.rb:46:in
`clean_id_attr_readers'': undefined method `each'' for
#<String:0x859ff44>
(NoMethodError)
from (erb):16:in `output''
from /opt/lib/ruby1.9/1.9.1/erb.rb:753:in `eval''
from /opt/lib/ruby1.9/1.9.1/erb.rb:753:in `result''
from
/home/myhome/gems/gems/wx_sugar-0.1.22/lib/wx_sugar/xrc/outputter.rb:19:in
`output''
from /home/myhome/gems/gems/wx_sugar-0.1.22/bin/xrcise:126:in `block (2
levels) in <top (required)>''
from /home/myhome/gems/gems/wx_sugar-0.1.22/bin/xrcise:125:in
`each''
from /home/myhome/gems/gems/wx_sugar-0.1.22/bin/xrcise:125:in `block in
<top (required)>''
from /home/myhome/gems/gems/wx_sugar-0.1.22/bin/xrcise:124:in
`open''
from /home/myhome/gems/gems/wx_sugar-0.1.22/bin/xrcise:124:in `<top
(required)>''
from /home/myhome/gems/bin/xrcise:19:in `load''
from /home/myhome/gems/bin/xrcise:19:in `<main>''
wxFormbuilder 3.0
wx_sugar version 0.1.22
wxruby-ruby19-2.0.1-x86-linux
wx_sugar-0.1.22
Ubuntu version 9.10 (Karmic Koala)
=============== .bashrc file =======================================
PATH=/opt/bin:/home/myhome/gems/bin:$PATH
LD_LIBRARY_PATH=/opt/lib:$LD_LIBRARY_PATH
export GEM_HOME=/home/myhome/gems
How do I make xrcise work properly? Thanks.
- Philip
_______________________________________________
wxruby-users mailing list
wxruby-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/wxruby-users
Hello Philip,
The problem you are having, is the fact that Ruby 1.9 String standard class
no longer implements the each method on it. Which basically, for string,
each splits the lines at the \n terminator, returning each line to the
block, so you need to create a library file, and have it included, as
follows:
string_each.rb:
class String
def each
self.split("\n").each do |line|
yield line
end
end
end
Then there''s two ways you can work this, either on the command line, do
the
following:
xrcise -rstring_each -o TestWxFb.rb TestWxFb.xrc
Or, modify the xrcise script itself, found in
/home/myhome/gems/gems/wx_sugar-0.1.22/bin/xrcise
And add a require ''string_each'' before any other require. I
will see about
fixing this bug, and doing a new release of wx_sugar to fix this problem
with Ruby 1.9, along with any other outstanding bugs that I can find in
regards to wx_sugar.
hth,
Mario
On Sun, Nov 22, 2009 at 9:28 PM, Philip Stephens <plusgforce at
gmail.com>wrote:
> Hi. I''m back. Unfortunately I can''t get xrcise working.
Here is the
> sample xrc file and the resulting error messages:
>
> =============== TestWxFb.xrc ========================================>
<?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="MyFrame2"
subclass="minFrame">
> <style>wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL</style>
> <size>500,300</size>
> <title>Minimal</title>
> <object class="wxBoxSizer">
> <orient>wxVERTICAL</orient>
> <object class="sizeritem">
> <option>0</option>
> <flag>wxALL|wxALIGN_CENTER_HORIZONTAL</flag>
> <border>5</border>
> <object class="wxStaticText"
name="m_staticText12">
> <label>Test</label>
> </object>
> </object>
> <object class="sizeritem">
> <option>1</option>
> <flag>wxEXPAND</flag>
> <border>5</border>
> <object class="wxBoxSizer">
> <orient>wxHORIZONTAL</orient>
> <object class="sizeritem">
> <option>0</option>
> <flag>wxALL</flag>
> <border>5</border>
> <object class="wxStaticText"
name="m_staticText13">
> <label>Username</label>
> </object>
> </object>
> <object class="sizeritem">
> <option>0</option>
> <flag>wxALL</flag>
> <border>5</border>
> <object class="wxTextCtrl"
name="m_textCtrl4">
> <value></value>
> <maxlength>0</maxlength>
> </object>
> </object>
> </object>
> </object>
> <object class="sizeritem">
> <option>1</option>
> <flag>wxEXPAND</flag>
> <border>5</border>
> <object class="wxBoxSizer">
> <orient>wxHORIZONTAL</orient>
> <object class="sizeritem">
> <option>0</option>
> <flag>wxALL</flag>
> <border>5</border>
> <object class="wxStaticText"
name="m_staticText14">
> <label>MyLabel</label>
> </object>
> </object>
> <object class="sizeritem">
> <option>0</option>
> <flag>wxALL</flag>
> <border>5</border>
> <object class="wxTextCtrl"
name="m_textCtrl5">
> <value></value>
> <maxlength>0</maxlength>
> </object>
> </object>
> </object>
> </object>
> </object>
> </object>
> </resource>
>
========================================================================>
> xxx:~/Desktop/Eyes$ xrcise -o TestWxFb.rb TestWxFb.xrc
> /home/myhome/gems/gems/wx_sugar-0.1.22/lib/wx_sugar/xrc/outputter.rb:46:in
> `clean_id_attr_readers'': undefined method `each'' for
#<String:0x859ff44>
> (NoMethodError)
> from (erb):16:in `output''
> from /opt/lib/ruby1.9/1.9.1/erb.rb:753:in `eval''
> from /opt/lib/ruby1.9/1.9.1/erb.rb:753:in `result''
> from
> /home/myhome/gems/gems/wx_sugar-0.1.22/lib/wx_sugar/xrc/outputter.rb:19:in
> `output''
> from /home/myhome/gems/gems/wx_sugar-0.1.22/bin/xrcise:126:in `block (2
> levels) in <top (required)>''
> from /home/myhome/gems/gems/wx_sugar-0.1.22/bin/xrcise:125:in
`each''
> from /home/myhome/gems/gems/wx_sugar-0.1.22/bin/xrcise:125:in `block in
> <top (required)>''
> from /home/myhome/gems/gems/wx_sugar-0.1.22/bin/xrcise:124:in
`open''
> from /home/myhome/gems/gems/wx_sugar-0.1.22/bin/xrcise:124:in `<top
> (required)>''
> from /home/myhome/gems/bin/xrcise:19:in `load''
> from /home/myhome/gems/bin/xrcise:19:in `<main>''
>
> wxFormbuilder 3.0
> wx_sugar version 0.1.22
> wxruby-ruby19-2.0.1-x86-linux
> wx_sugar-0.1.22
> Ubuntu version 9.10 (Karmic Koala)
>
> =============== .bashrc file =======================================>
> PATH=/opt/bin:/home/myhome/gems/bin:$PATH
> LD_LIBRARY_PATH=/opt/lib:$LD_LIBRARY_PATH
> export GEM_HOME=/home/myhome/gems
>
> How do I make xrcise work properly? Thanks.
> - Philip
>
>
> _______________________________________________
> wxruby-users mailing list
> wxruby-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wxruby-users
>
--
Mario Steele
http://www.trilake.net
http://www.ruby-im.net
http://rubyforge.org/projects/wxruby/
http://rubyforge.org/projects/wxride/
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/wxruby-users/attachments/20091123/72a8a668/attachment-0001.html>