[wxruby-users] wxRuby & RubyScript2exe

Matthew Webb bmatthew1 at blueyonder.co.uk
Fri Mar 28 10:52:12 EDT 2008


Alex Fenton wrote:
> Matthew Webb wrote:
>   
>> It would seem that the problem isn't 'list.xpm' not loading but 
>> 'mondrian.ico' not loading.
>>
>> I've added the following two lines to the beginning of 'controls.rb'...
>>
>> require "rubyscript2exe"
>> RUBYSCRIPT2EXE.bin = ["mondrian.ico"]
>>
>> When I run the .exe I get this error...
>>
>> Icon file does not exist: 
>> C:\Users\Matthew\eee\eee.controls.exe.2\app/mondrian.ico (ArgumentError)
>>
>> It's really strange because 'mondrian.ico' is in the same folder as 
>> 'Controls.rb' so I'd expect it to be found.
>>     
> You've put it in the 'bin' dir of the package, but controls.rb is in the 
> 'app' dir. controls.rb loads the icon file like this:
>
> Icon.new( File.join( File.dirname(__FILE__), "mondrian.ico"),
>                   Wx::BITMAP_TYPE_ICO )
>
> i.e. relative to its position. So it looks in the app dir, doesn't find 
> it and gives the error you saw. You'll either need to put the icon file 
> somewhere different in the bundle, or change that code.
>
> You might find it helpful to unpack the bundle rubyscript2exe creates to 
> see the directory structure. See the page for more details, but 
> basically run it with the argument ---eee-justextract
>
> alex
>
> _______________________________________________
> wxruby-users mailing list
> wxruby-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wxruby-users
>
>
>
>   
Okay I've finally managed to fix the problem I was having.

I found the following thread regarding rubyscript2exe & image loading...

http://objectmix.com/ruby/303278-re-rubyscript2exe-cannot-put-picture-project.html

If I rename the controls.rb file to init.rb & then "compile" the entire 
controls Directory like...

C:\Users\Matthew\Desktop>rubyscript2exe controls/

it works fine.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20080328/53c59523/attachment.html 


More information about the wxruby-users mailing list