# Wxruby2 problems

**URL:** <https://www.ruby-forum.com/t/wxruby2-problems/127779>\
**Category:** wxRuby\
**Created:** [February 1, 2008, 8:31am UTC](https://www.ruby-forum.com/t/wxruby2-problems/127779 "2008-02-01T08:31:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eliben](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/3bc359/32.png) [@eliben](https://www.ruby-forum.com/u/eliben)\
**Post date:** [February 1, 2008, 8:31am UTC](https://www.ruby-forum.com/t/wxruby2-problems/127779/1 "2008-02-01T08:31:01Z")

</div>

Hello,

I’ve recently installed wxruby2 (version 1.9.4) from a precompiled  
mswin32 gem. It seems to work fine, and the samples in the  
distribution all work, but I have a couple of peculiar problems:

1. When I package a trivial wxruby script with rubyscript2exe, the  
executable is huge - 8.5 MB. With previous versions of wxruby (prior  
to wxruby2, I think) it was much smaller. Less than 3 MB. Is this how  
much the new wxruby takes, or am I doing something wrong ?

Note: Alex F. answered in the Ruby list that it’s a script2exe bug.  
Could you please elaborate on the steps needed to reduce the exe size ?

1. [warning: this is bizarre!] While running a script with a wxruby  
GUI, my mouse (trackball, actually) becomes much slower. It’s  
configured to be quite fast because I have a large script, but slows  
down (by a factor of 2, at least) while the script is running. When  
the script exits, the cursor regains its original speed. This does not  
happen with simple ruby scripts (those without wxruby)

This simple hello world app (from the website) causes the problem as  
well:

require “wx”  
include Wx  
class HelloWorld \< App # a new class which derives from the Wx::App  
class  
def on\_init # we’re defining what the application is going to do  
when it  
starts  
helloframe = Frame.new(nil, -1, “Hello World”) # it’s going to  
make a  
frame entitled “Hello World”  
StaticText.new(helloframe,-1,“Hello World”) # it’s going to put  
the  
text “Hello World” in that frame  
helloframe.show() # and then it’s going to make the window appear  
end  
end  
HelloWorld.new.main\_loop # and this line makes it actually do it!

Please help,  
Eli

---

<div class="post-metadata">

**Author:** ![eliben](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/3bc359/32.png) [@eliben](https://www.ruby-forum.com/u/eliben)\
**Post date:** [February 1, 2008, 12:16pm UTC](https://www.ruby-forum.com/t/wxruby2-problems/127779/2 "2008-02-01T12:16:11Z")

</div>

Eli B. wrote:

> 1. When I package a trivial wxruby script with rubyscript2exe, the  
> executable is huge - 8.5 MB. With previous versions of wxruby (prior  
> to wxruby2, I think) it was much smaller. Less than 3 MB. Is this how  
> much the new wxruby takes, or am I doing something wrong ?
> 
> Note: Alex F. answered in the Ruby list that it’s a script2exe  
> bug. Could you please elaborate on the steps needed to reduce the exe  
> size ?

(Plain text is preferred on this list, please)

1. Create the .exe file using rubyscript2exe as normal  
rubyscript2exe my\_app.rb

2. Run the newly-created .exe file with the argument --eee-justextract  
my\_app.exe --eee-justextract

3. Edit the file “myapp/app.eee”. Delete the line reading “f  
bin\wxruby2.so”

4. Change into the directory and repack the executable  
cd my\_app  
eee.exe app.eee ../my\_new\_app.exe

5. Test that my\_new\_app.exe works. It should be about 3-4MB smaller than  
the original

I have reported this bug to the maintainer of rs2exe, but haven’t had  
any response.

> 1. [warning: this is bizarre!] While running a script with a wxruby  
> GUI, my mouse (trackball, actually) becomes much slower. It’s  
> configured to be quite fast because I have a large script, but slows  
> down (by a factor of 2, at least) while the script is running. When  
> the script exits, the cursor regains its original speed. This does not  
> happen with simple ruby scripts (those without wxruby)

Strange, I have never seen this before. Do you have any special software  
for your trackball, or are you just using your standard system settings  
to make it fast? Does is slow down across the whole system, or just when  
you’re in the wxRuby app?

alex
