Forum: FXRuby How to create an object of File dialog box

73700e119917433681f2e8f3e4369f74?d=identicon&s=25 Li CN (alex-osu3)
on 2008-09-27 20:56
Hi all,

I want to create a file dialog box. And I copy a script from FXRuby (by
Lyle Johnson) as follow:

require 'fox16'
include Fox

dialog=FXFileDialog.new(self,"Open Files")  #line 4
dialog.patternList=[
                          "All Files (*)",
                          "JPEG Files(*.jpg,*jpeg)"
                    ]

dialog.selectMode=SELECTFILE_EXISTING
if dialog.execute!=0
  open_jpeg_file(dialog.filename)
end

Ruby complains at line 4:

>ruby dialogFiles1.rb
c:/ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/kwargs.rb:789:in
`old_initialize': No matching function for overloaded 'new_FXFileDialog'
(ArgumentError)
  from
c:/ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/kwargs.rb:789:in
`initialize'
  from dialogFiles1.rb:4:in `new'
  from dialogFiles1.rb:4

I wonder what I miss?

Thanks,

Li
This topic is locked and can not be replied to.