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

Bec38d63650c8912b6ba9b557fb953b9?d=identicon&s=25 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
13313ac2ec7ba7c43b1b952db034ff3b?d=identicon&s=25 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
Bec38d63650c8912b6ba9b557fb953b9?d=identicon&s=25 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

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.