Thank you for publishing WxRuby. I am enjoying the time spent learning
to use it.
I now have a 2000 line program that has found a bug in the sample
printing.rb code and one in the WxRuby printing subsystem.
In the sample code for printing, svn - Revision 2112:
/trunk/wxruby/samples/printing/printing.rb, the page one code does not
the graphics to the printed page size. For an a4 page it is printed at
same scale as it appears on screen. And while it prints the second page
it shows a blank page in the printpreview window.
The error is that the scaling code is using integer division instead of
floating point division. The patch below fixes this bug.
< overall_scale = scale * (w/page_width)
overall_scale = scale * (w.fdiv(page_width))
The second bug is something that I can not fix. If I apply the following
patch to printing.rb, ruby will fail with a segmentation fault as I
the page setup dialog every time.
If I dont apply the patch, the segmentation fault will only appear when
exit the application. I would appreciate your response on this matter.
< page_setup_dialog = Wx::PageSetupDialog.new(self,
page_setup_dialog = Wx::PageSetupDialog.new(nil,
I am using ruby 1.9.1p376 (2009-12-07 revision 26041) [i386-mswin32] and
A wxRuby distribution for Windows bundling :
- ruby-1.9.1-p243 with its minimal dependency (zlib, iconv) built with
- built with wxWidgets-2.8.10
- associated documentation and samples
- RMagick-2.11.0 built with ImageMagick-6.5.5-6 with PNG/JPEG/TIFF