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

Posted by Li Chen (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
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.