[fxruby-users] Printing under FXRuby

Philippe Lang philippe.lang at attiksystem.ch
Fri Mar 7 04:09:24 EST 2008


Hi,

I've been trying to print with FXRuby, and I have to say I was not able
to do it, or find a tutorial explaning it.

When trying to draw anything inside the dc, my application bombs:

-------------------------------
using HP Color LaserJet 4550 PS
c:/erp/ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.12-mswin32/lib/fox16/itera
tors.rb:
344: [BUG] Segmentation fault
ruby 1.8.6 (2007-03-13) [i386-mswin32]
-------------------------------

I've bee trying different mixes of beginPrint / beginPage, and the last
thing I've been trying is:

-------------------------------
print_dialog = FXPrintDialog.new(self, "Print Something")
if print_dialog.execute != 0
  print_instance = FXDCPrint.new($app)
  print_instance.beginPrint(print_dialog.printer) do |dc|
    print_instance.beginPage(1) do |dc|
      dc.drawImage(@image, 0, 0)
    end
  end
end
-------------------------------

I came accross an old post of year 2002 saying FXDCPrint was not working
yet. Is it still the case maybe? Most likely, I'm doing something
wrong... Can anyone help?

Thanks,

Philippe


More information about the fxruby-users mailing list