Forum: JRuby awt.FileDialog.set_filename_filter doesn't work

Posted by Roger Pack (rogerdpack)
on 2012-05-16 21:22
Anybody have any ideas why my "filename filter" doesn't appear to get
called here?


require 'java'
java_import java.awt.FileDialog
    out = FileDialog.new(nil, "title", FileDialog::LOAD)
      out.set_filename_filter {|file, name|
    puts 'hello' # never reached
  }
out.show
Posted by Thomas E Enebo (Guest)
on 2012-05-16 22:03
(Received via mailing list)
This works for me (master and 1.6.7) and prints out the same number of
'hello' as the current director seems to have files.   The dialog may
not print anything if it remembers a previous directory which contains
no files/dirs.  When mine pops up it is in a weird directory
(MacOS...I wonder where last dir is stored...).  Perhaps that is the
issue?

-Tom

On Wed, May 16, 2012 at 2:22 PM, Roger Pack <lists@ruby-forum.com> 
wrote:
> out.show
>
> --
> Posted via http://www.ruby-forum.com/.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>  http://xircles.codehaus.org/manage_email
>
>



--
blog: http://blog.enebo.com   twitter: tom_enebo
mail: tom.enebo@gmail.com
Posted by Roger Pack (rogerdpack)
on 2012-05-23 18:15
yes I think it may have been a default directory thing because when I 
took the same code to a different (OS and machine), it seemed to start 
working. Weird.
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.